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