Exemplo n.º 1
0
        private static void Generate(string pathToData, bool recompile, System.Func <FlowWindow, bool> predicate)
        {
            var filename  = Path.GetFileName(pathToData);
            var directory = pathToData.Replace(filename, string.Empty);

            FlowCompilerSystem.currentProject          = Path.GetFileNameWithoutExtension(pathToData);
            FlowCompilerSystem.currentProjectDirectory = directory;

            var basePath = directory + FlowCompilerSystem.currentProject;

            IO.CreateDirectory(basePath, string.Empty);
            IO.CreateDirectory(basePath, FlowDatabase.OTHER_NAME);

            predicate = predicate ?? delegate { return(true); };

            AssetDatabase.StartAssetEditing();
            {
                try {
                    var windows = FlowSystem.GetWindows().Where(w => !w.isDefaultLink && predicate(w));

                    foreach (var each in windows)
                    {
                        var relativePath = IO.GetRelativePath(each, "/");
                        FlowCompilerSystem.GenerateWindow(basePath + relativePath + "/", each, recompile);
                    }
                } catch (Exception e) {
                    Debug.LogException(e);
                }
            }
            AssetDatabase.StopAssetEditing();
            AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);

            FlowSystem.SetDirty();
            FlowSystem.Save();
        }
Exemplo n.º 2
0
        public static void GenerateByTags(string pathToData, int[] tags, bool recompile = false)
        {
            FlowCompilerSystem.Generate(pathToData, recompile, flowWindow => {
                foreach (var tag in flowWindow.tags)
                {
                    if (tags.Contains(tag) == true)
                    {
                        return(true);
                    }
                }

                return(false);
            });
        }
Exemplo n.º 3
0
 public static void Generate(string pathToData, bool recompile = false)
 {
     FlowCompilerSystem.Generate(pathToData, recompile, null);
 }
Exemplo n.º 4
0
 public static void GenerateByWindow(string pathToData, bool recompile = false, FlowWindow window = null)
 {
     FlowCompilerSystem.Generate(pathToData, recompile, flowWindow => flowWindow == window);
 }
Exemplo n.º 5
0
 public static void GenerateByTag(string pathToData, int tag, bool recompile = false)
 {
     FlowCompilerSystem.Generate(pathToData, recompile, flowWindow => flowWindow.tags.Contains(tag));
 }