今天使用HUDText的时候,发现须要如今场景里创建一个UI2dRoot;不然位置不对
或许应该创建一个prefab这样每一个场景都加入一个就可以。
using UnityEngine; using UnityEditor; public class FixStupidEditorBehavior : MonoBehaviour { [MenuItem("GameObject/Create Empty Parent #&e")] static void createEmptyParent() { GameObject go = new GameObject("GameObject"); if(Selection.q=activeTransform">activeTransform != null) { } } [MenuItem("GameObject/Create Empty Duplicate #&d")] static void createEmptyDuplicate() { q=GameObject">GameObject go = new q=GameObject">GameObject("GameObject"); { } } [MenuItem("GameObject/Create Empty Child #&c")] static void createEmptyChild() { GameObject go = new GameObject("GameObject"); if(Selection.activeTransform != null) { } } }
载入场景注意:异步载入场景的时候,NGUI是无法正常绘制的,须要用原生的OnGUI