Пример #1
0
        void Start()
        {
#if UNITY_EDITOR
            if (instance == null) instance = this;
#endif
            if (!initFinished)
            {
                init();
                initFinished = true;
            }
        }
Пример #2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (Application.isPlaying)
        {
            if (pmc == null) pmc = ZakoFarController.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("编辑后记得复制组件然后再非编辑模式下覆盖原组件的值!");
                }
            }
        }

    }
Пример #3
0
 public override void begin(KGCharacterController cc)
 {
     if(zc == null)zc = (ZakoFarController)cc;
     zc.m_SkeletonAnim.state.Event += OnEvent;
 }