示例#1
0
        static string[] OnWillSaveAssets(string[] paths)
        {
            if (paths.Any(p => Path.GetExtension(p) == ".unity" &&
                          !string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(p))))
            {
                // Build All VS, before returning.
                EditorReducers.BuildAll(null);
            }

            return(paths);
        }
示例#2
0
 public void RegisterReducers()
 {
     // Register reducers.
     UIReducers.Register(this);
     EditorReducers.Register(this);
     GraphAssetReducers.Register(this);
     GraphReducers.Register(this);
     StackReducers.Register(this);
     NodeReducers.Register(this);
     EdgeReducers.Register(this);
     VariableReducers.Register(this);
     PropertiesReducers.Register(this);
     StickyNoteReducers.Register(this);
 }
        static AssetWatcher()
        {
            s_Instance = new AssetWatcher();
            Instance.m_ProjectAssetPaths = new Dictionary <string, string>();

            var graphAssetGUIDs = AssetDatabase.FindAssets("t:" + typeof(VSGraphAssetModel).Name);

            foreach (var guid in graphAssetGUIDs)
            {
                var path            = AssetDatabase.GUIDToAssetPath(guid);
                var graphAssetModel = AssetDatabase.LoadMainAssetAtPath(path) as GraphAssetModel;
                s_Instance.WatchGraphAssetAtPath(path, graphAssetModel);
            }
            // TODO: be smarter
            AssetDatabase.importPackageCompleted += name =>
            {
                EditorReducers.BuildAll(null);
            };
        }
示例#4
0
        static AssetWatcher()
        {
            s_Instance = new AssetWatcher();
            Instance.m_ProjectAssetPaths = new HashSet <string>();

            var graphAssetGUIDs = AssetDatabase.FindAssets("t:" + typeof(VSGraphAssetModel).Name);

            foreach (var guid in graphAssetGUIDs)
            {
                var assetPath       = AssetDatabase.GUIDToAssetPath(guid);
                var graphAssetModel = AssetDatabase.LoadMainAssetAtPath(assetPath) as VSGraphAssetModel;
                if (graphAssetModel)
                {
                    // HACK: should not hardcode the Script suffix
                    Instance.m_ProjectAssetPaths.Add(assetPath);
                }
            }
            // TODO: be smarter
            AssetDatabase.importPackageCompleted += name =>
            {
                EditorReducers.BuildAll(null);
            };
        }
示例#5
0
 public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
 {
     EditorReducers.BuildAll(null);
 }