public static QuickUnityEditorEventsWatcher Observe() { QuickUnityEditorEventsWatcher w = new QuickUnityEditorEventsWatcher(); allWatchers.Add(w); return(w); }
static ProjectEditorViewWatcher() { QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe(); watcher.SceneView.OnSceneGUIDelegate.AddListener(onSceneViewGUI); watcher.PrefabUtility.OnPrefabInstanceUpdated.AddListener(OnPrefabInstanceUpdated); watcher.EditorApplication.OnPlayModeStateChanged.AddListener(OnPlayModeStateChanged); }
static ProjectBuildTargetWatcher() { QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe(); watcher.BuildTarget.OnBuildTargetChanged.AddListener(target => { Debug.Log("Switch Platform Successed, Current Platform : {0}", target); }); }
//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; }
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; }); } }
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); }); }
static ProjectWindowWatcher() { QuickUnityEditorEventsWatcher watcher = QuickUnityEditorEventsWatcher.Observe(); watcher.ProjectView.OnProjectWindowItemOnGUI.AddListener(ProjectWindowItemOnGUI); }
private static void RemoveWatcher(QuickUnityEditorEventsWatcher watcher) { allWatchers.Remove(watcher); }