static ProjectEventWatcher()
        {
            QuickUnityEditorEventWatcher watcher = QuickUnityEditorEventWatcher.Observe();

            watcher.SceneView.onSceneGUIDelegate.AddListener(onSceneViewGUI);
            watcher.PrefabUtility.onPrefabInstanceUpdated.AddListener(OnPrefabInstanceUpdated);
        }
示例#2
0
        static UnityScripsCompileWatcher()
        {
            QuickUnityEditorEventWatcher projectEditorEventWatcher = QuickUnityEditorEventWatcher.Observe();

            projectEditorEventWatcher.onUpdate.AddListener(onUpdate);

            QuickAssetWatcher watcher = QuickAssetWatcher.Observe();

            watcher.onAssetCreated.AddListener(onAssetHandle);
            watcher.onAssetModified.AddListener(onAssetHandle);
        }
        static ProjectAssetsWatcher()
        {
            QuickUnityEditorEventWatcher editorEventWatcher = QuickUnityEditorEventWatcher.Observe();

            editorEventWatcher.BuildTarget.onActiveBuildTargetChanged.AddListener(target =>
            {
                UnityEngine.Debug.Log("当前平台为: " + target);
            });

            // Observe the entire assets folder for changes
            var watcher = QuickAssetWatcher.Observe();

            watcher.onAssetCreated.AddListener(asset =>
            {
                Debug.Log(string.Format(LOG_FORMAT, LOG_TAG, " <color=cyan>Created</color> asset '" + asset.Name + "' of type " + asset.Type));
            });

            watcher.onAssetDeleted.AddListener(asset =>
            {
                Debug.Log(string.Format(LOG_FORMAT, LOG_TAG, " <color=red>Deleted</color> asset '" + asset.Name + "' of type " + asset.Type));
            });

            watcher.onAssetModified.AddListener(asset =>
            {
                Debug.Log(string.Format(LOG_FORMAT, LOG_TAG, " <color=orange>Modified</color> asset '" + asset.Name + "' of type " + asset.Type));
            });

            watcher.onAssetMoved.AddListener((before, after) =>
            {
                Debug.Log(string.Format(LOG_FORMAT, LOG_TAG, " <color=blue>Moved</color> asset '" + before.Name + "' from '" + before.DirectoryName + "' to '" + after.DirectoryName + "'"));
            });

            watcher.onAssetRenamed.AddListener((before, after) =>
            {
                Debug.Log(string.Format(LOG_FORMAT, LOG_TAG, " <color=magenta>Renamed</color> asset from '" + before.Name + "' to '" + after.Name + "'"));
            });
        }
        static ProjectWindowWatcher()
        {
            QuickUnityEditorEventWatcher projectEditorEventWatcher = QuickUnityEditorEventWatcher.Observe();

            projectEditorEventWatcher.onProjectWindowItemOnGUI.AddListener(ProjectWindowItemOnGUI);
        }