![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Unity
阿晚喵
菜
展开
-
Unity给一个Prefab添加子物体报错Setting the parent of a transform which resides in a Prefab Asset is disabled t
今天在写一个批量修改预制体的Editor脚本,在写给一个预制体添加子物体时,出现了Setting the parent of a transform which resides in a Prefab Asset is disabled to prevent data corruption的报错。具体报错代码简化后如下: GameObject parentPrefab = AssetData...原创 2020-01-02 19:51:46 · 9048 阅读 · 7 评论 -
Unity中通过脚本改变Button的颜色
Unity默认的按钮颜色:创建一个脚本输入以下代码,然后把脚本挂到按钮上。using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;public class ButtonColor : MonoBehaviour { void Start () ...原创 2019-03-05 15:03:36 · 10381 阅读 · 0 评论