/** 初始化 */ private static void init() { if (!ShineSetting.isRelease) { //编辑器模式 ShineSetting.isEditor = true; } //如果运行中,就停止,防止unity的内存清空导致一堆无意义报错 if (EditorApplication.isPlaying) { EditorApplication.isPlaying = false; } EditorApplication.update += Update; EditorApplication.hierarchyChanged += OnHierarchyChanged; EditorApplication.hierarchyWindowItemOnGUI += HierarchyWindowItemOnGUI; EditorApplication.projectChanged += OnProjectChanged; EditorApplication.projectWindowItemOnGUI += ProjectWindowItemOnGUI; EditorApplication.modifierKeysChanged += OnModifierKeysChanged; EditorApplication.searchChanged += OnSearchChanged; EditorApplication.pauseStateChanged += OnPauseStateChanged; EditorApplication.playModeStateChanged += OnPlayModeStateChanged; PrefabUtility.prefabInstanceUpdated += onPrefabUpdated; _version = MathUtils.randomInt(); _callLaterList = new SList <Action>(); _updateList = new SList <Action>(); _isNewOnce = true; }