Esempio n. 1
0
        void Start()
        {
#if UNITY_EDITOR
            if (instance == null) instance = this;
#endif
            if (!initFinished)
            {
                init();
                initFinished = true;
            }
        }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (Application.isPlaying)
        {
            if (pmc == null) pmc = SpiderQueenController.instance;
            tmpIndex = EditorGUILayout.IntField("使用的技能(-1未设置):", tmpIndex);
            if (tmpIndex != pmc.AnimIndex)
            {
                if (tmpIndex < pmc.GetBehaviorCount() && tmpIndex != -1)
                {
                    pmc.AnimIndex = tmpIndex;
                    Debug.Log("编辑后记得复制组件然后再非编辑模式下覆盖原组件的值!");
                }
                else
                {
                    tmpIndex = -1;
                    pmc.AnimIndex = tmpIndex;
                    Debug.Log("编辑后记得复制组件然后再非编辑模式下覆盖原组件的值!");
                }
            }
        }

    }