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(); }
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); }); }
public static void Generate(string pathToData, bool recompile = false) { FlowCompilerSystem.Generate(pathToData, recompile, null); }
public static void GenerateByWindow(string pathToData, bool recompile = false, FlowWindow window = null) { FlowCompilerSystem.Generate(pathToData, recompile, flowWindow => flowWindow == window); }
public static void GenerateByTag(string pathToData, int tag, bool recompile = false) { FlowCompilerSystem.Generate(pathToData, recompile, flowWindow => flowWindow.tags.Contains(tag)); }