コード例 #1
0
        public static QuickUnityEditorEventsWatcher Observe()
        {
            QuickUnityEditorEventsWatcher w = new QuickUnityEditorEventsWatcher();

            allWatchers.Add(w);
            return(w);
        }
コード例 #2
0
        static ProjectEditorViewWatcher()
        {
            QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe();

            watcher.SceneView.OnSceneGUIDelegate.AddListener(onSceneViewGUI);
            watcher.PrefabUtility.OnPrefabInstanceUpdated.AddListener(OnPrefabInstanceUpdated);
            watcher.EditorApplication.OnPlayModeStateChanged.AddListener(OnPlayModeStateChanged);
        }
コード例 #3
0
        static ProjectBuildTargetWatcher()
        {
            QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe();

            watcher.BuildTarget.OnBuildTargetChanged.AddListener(target =>
            {
                Debug.Log("Switch Platform Successed, Current Platform : {0}", target);
            });
        }
コード例 #4
0
        //public enum CompilerOptions
        //{
        //    ForceStopPlay,
        //    LockReloadAssemblies
        //}

        //private static CompilerOptions mCompiler = CompilerOptions.ForceStopPlay;
        //private static bool mIsLockReloadAssemblies = false;
        //private static bool mIsImportScripts = false;

        static UnityScripsCompileWatcher()
        {
            QuickUnityEditorEventsWatcher mEventWatcher = QuickUnityEditorEventsWatcher.Observe();

            mEventWatcher.EditorApplication.OnUpdate.AddListener(onEditorUpdate);

            //QuickAssetWatcher watcher = QuickAssetWatcher.Observe();
            //watcher.onAssetCreated.AddListener(onAssetHandle);
            //watcher.onAssetModified.AddListener(onAssetHandle);

            UnityScripsCompileTimeTracker.KeyframeAdded += UnityScripsCompileWatcher.LogCompileTimeKeyframe;
        }
コード例 #5
0
        private static void OnPrefabInstanceUpdated(GameObject instance)
        {
            GameObject go = null;

            if (Selection.activeTransform)
            {
                go = Selection.activeGameObject;
            }
            AssetDatabase.SaveAssets();
            if (go)
            {
                QuickUnityEditorEventsWatcher.Observe().EditorApplication.OnDelayCall.AddListener(delegate
                {
                    Selection.activeGameObject = go;
                });
            }
        }
コード例 #6
0
        static QuickSDKBuildWatcher()
        {
            QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe();

            watcher.QuickSDKBuildPipeline.OnPreApply.AddListener((target, path) =>
            {
                Debug.Log("QuickSDKBuildPipeline -> OnPreApply : {0}, {1}", target, path);
            });
            watcher.QuickSDKBuildPipeline.OnApplySDK.AddListener((target, path) =>
            {
                Debug.Log("QuickSDKBuildPipeline -> OnApplySDK : {0}, {1}", target, path);
            });
            watcher.QuickSDKBuildPipeline.OnPreBuild.AddListener((target, path) =>
            {
                Debug.Log("QuickSDKBuildPipeline -> OnPreBuild : {0}, {1}", target, path);
            });
            watcher.QuickSDKBuildPipeline.OnPostBuild.AddListener((target, path) =>
            {
                Debug.Log("QuickSDKBuildPipeline -> OnPostBuild : {0}, {1}", target, path);
            });
        }
コード例 #7
0
        static ProjectWindowWatcher()
        {
            QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe();

            watcher.ProjectView.OnProjectWindowItemOnGUI.AddListener(ProjectWindowItemOnGUI);
        }
コード例 #8
0
 private static void RemoveWatcher(QuickUnityEditorEventsWatcher watcher)
 {
     allWatchers.Remove(watcher);
 }