/// <summary> Refreshes the entire database by removing empty, duplicate and unnamed entries, sorting the database and updating the sound names list </summary> /// <param name="performUndo"> Record changes? </param> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void RefreshDatabase(bool performUndo, bool saveAssets) { DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.1f); if (performUndo) { UndoRecord(UILabels.RefreshDatabase); } bool addedTheNoSoundSoundGroup = AddNoSound(); RemoveUnreferencedData(); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.2f); RemoveUnnamedEntries(false); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.3f); RemoveDuplicateEntries(false); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.4f); bool foundDataWithWrongDatabaseName = CheckAllDataForCorrectDatabaseName(false); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.5f); Sort(false); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.6f); UpdateSoundNames(false); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 0.7f); SetDirty(saveAssets && (addedTheNoSoundSoundGroup || foundDataWithWrongDatabaseName)); DoozyUtils.DisplayProgressBar(UILabels.SoundyDatabase + ": " + DatabaseName, UILabels.RefreshDatabase, 1f); DoozyUtils.ClearProgressBar(); }
private static void CreateSettingsAssets() { DoozyUtils.ClearProgressBar(); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.1f); DoozyWindowSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.2f); NodyWindowSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.3f); SoundySettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.4f); TouchySettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.5f); UIButtonSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.6f); UICanvasSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.7f); UIDrawerSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.8f); UIPopupSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.85f); UIToggleSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Settings Assets...", 0.9f); UIViewSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Saving Settings Assets...", 0.95f); DoozyUtils.SaveAssets(); DoozyUtils.ClearProgressBar(); }
/// <summary> Refreshes the entire database by adding the default categories, removing empty and duplicate entries, sorting the database and updating the category names list </summary> /// <param name="performUndo"> Record changes? </param> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void RefreshDatabase(bool performUndo, bool saveAssets) { string title = UILabels.Database + ": " + DatabaseType; // ProgressBar Title string info = UILabels.RefreshDatabase; // ProgressBar Info DoozyUtils.DisplayProgressBar(title, info, 0.1f); if (performUndo) { UndoRecord(UILabels.RefreshDatabase); } RemoveUnreferencedData(false); DoozyUtils.DisplayProgressBar(title, info, 0.2f); RemoveEmptyNames(false); DoozyUtils.DisplayProgressBar(title, info, 0.3f); RemoveDuplicateNamesFromCategories(false); DoozyUtils.DisplayProgressBar(title, info, 0.4f); AddDefaultCategories(false); DoozyUtils.DisplayProgressBar(title, info, 0.6f); Sort(false, false); DoozyUtils.DisplayProgressBar(title, info, 0.8f); UpdateListOfCategoryNames(); DoozyUtils.DisplayProgressBar(title, info, 1f); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
private static void RegenerateDatabaseAssets() { DoozyUtils.ClearProgressBar(); //SOUNDY DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.1f); SoundySettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.2f); SoundySettings.Database.RefreshDatabase(false, true); //UIAnimations DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.3f); UIAnimations.Instance.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.4f); UIButtonSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.6f); UICanvasSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.7f); UIDrawerSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.8f); UIPopupSettings.Database.SearchForUnregisteredLinks(false); DoozyUtils.DisplayProgressBar("Hold On", "Regenerating Databases...", 0.9f); UIViewSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold On", "Saving Database Assets...", 0.95f); DoozyUtils.SaveAssets(); DoozyUtils.ClearProgressBar(); }
private static void CreateSettingsAssets(bool saveAssets = true) { DoozyUtils.ClearProgressBar(); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - DoozyWindowSettings", 0.1f); DoozyWindowSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - NodyWindowSettings", 0.2f); NodyWindowSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - SoundySettings", 0.3f); SoundySettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - ThemesSettings", 0.35f); ThemesSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - TouchySettings", 0.4f); TouchySettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIButtonSettings", 0.5f); UIButtonSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UICanvasSettings", 0.6f); UICanvasSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIDrawerSettings", 0.7f); UIDrawerSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIPopupSettings", 0.8f); UIPopupSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIToggleSettings", 0.85f); UIToggleSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIViewSettings", 0.9f); UIViewSettings.Instance.SetDirty(false); if (saveAssets) { DoozyUtils.DisplayProgressBar("Hold on...", "Saving Assets...", 0.95f); DoozyUtils.SaveAssets(); } DoozyUtils.ClearProgressBar(); }
public static void Run() { if (EditorApplication.isCompiling || EditorApplication.isUpdating) { DelayedCall.Run(2f, Run); return; } DoozyPath.CreateMissingFolders(); CreateSettingsAssets(false); CreateDatabaseAssets(false); RegenerateDatabaseAssets(false); ProcessorsSettings.Instance.RunDoozyAssetsProcessor = false; ProcessorsSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Saving Processor Settings...", 0.95f); DoozyUtils.SaveAssets(); DoozyUtils.ClearProgressBar(); #if !dUI_MASTER if (AssetDatabase.IsValidFolder("Assets/DoozyInstaller")) { AssetDatabase.MoveAssetToTrash("Assets/DoozyInstaller"); } #endif }
private static void CreateDatabaseAssets(bool saveAssets = true) { DoozyUtils.ClearProgressBar(); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIAnimations", 0.1f); UIAnimations.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - SoundySettings", 0.15f); SoundySettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - ThemesSettings", 0.2f); ThemesSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIButtonSettings", 0.3f); UIButtonSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UICanvasSettings", 0.5f); UICanvasSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIDrawerSettings", 0.7f); UIDrawerSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIPopupSettings", 0.8f); UIPopupSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold on...", "Check Asset - UIViewSettings", 0.9f); UIViewSettings.Database.SetDirty(false); if (saveAssets) { DoozyUtils.DisplayProgressBar("Hold on...", "Saving Assets...", 0.95f); DoozyUtils.SaveAssets(); } DoozyUtils.ClearProgressBar(); }
private static void RegenerateDatabaseAssets(bool saveAssets = true) { DoozyUtils.ClearProgressBar(); //SOUNDY DoozyUtils.DisplayProgressBar("Hold on...", "Soundy - Search For Unregistered Databases", 0.1f); SoundySettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold on...", "Soundy - Refresh", 0.2f); SoundySettings.Database.RefreshDatabase(false, false); //UIAnimations DoozyUtils.DisplayProgressBar("Hold on...", "UIAnimations - Search For Unregistered Databases", 0.3f); UIAnimations.Instance.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold on...", "Buttons - Search For Unregistered Databases", 0.4f); UIButtonSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold on...", "Canvases - Search For Unregistered Databases", 0.6f); UICanvasSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold on...", "Drawers - Search For Unregistered Databases", 0.7f); UIDrawerSettings.Database.SearchForUnregisteredDatabases(false); DoozyUtils.DisplayProgressBar("Hold on...", "Popups - Search For Unregistered Databases", 0.8f); UIPopupSettings.Database.SearchForUnregisteredLinks(false); DoozyUtils.DisplayProgressBar("Hold on...", "Views - Search For Unregistered Databases", 0.9f); UIViewSettings.Database.SearchForUnregisteredDatabases(false); if (saveAssets) { DoozyUtils.DisplayProgressBar("Hold on...", "Saving Assets...", 0.95f); DoozyUtils.SaveAssets(); } DoozyUtils.ClearProgressBar(); }
/// <summary> [Editor Only] Performs a deep search through the project for any unregistered UIAnimationDatabase asset files and adds them to the corresponding Database </summary> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void SearchForUnregisteredDatabases(bool saveAssets) { DoozyUtils.DisplayProgressBar("UIAnimations", "Initializing", 0.1f); Initialize(); DoozyUtils.DisplayProgressBar("UIAnimations", "Searching for databases", 0.3f); bool foundUnregisteredDatabase = false; UIAnimationDatabase[] array = Resources.LoadAll <UIAnimationDatabase>(""); if (array == null || array.Length == 0) { DoozyUtils.ClearProgressBar(); return; } DoozyUtils.DisplayProgressBar("UIAnimations", "Updating databases", 0.5f); foreach (UIAnimationDatabase foundDatabase in array) { UIAnimationsDatabase database = Get(foundDatabase.DataType); if (database == null) { continue; } if (database.Contains(foundDatabase)) { continue; } database.AddUIAnimationDatabase(foundDatabase); foundUnregisteredDatabase = true; } if (!foundUnregisteredDatabase) { DoozyUtils.ClearProgressBar(); return; } DoozyUtils.DisplayProgressBar("UIAnimations", "Update Show", 0.6f); Show.Update(); DoozyUtils.DisplayProgressBar("UIAnimations", "Update Hide", 0.6f); Hide.Update(); DoozyUtils.DisplayProgressBar("UIAnimations", "Update Loop", 0.7f); Loop.Update(); DoozyUtils.DisplayProgressBar("UIAnimations", "Update Punch", 0.8f); Punch.Update(); DoozyUtils.DisplayProgressBar("UIAnimations", "Update State", 0.9f); State.Update(); DoozyUtils.DisplayProgressBar("UIAnimations", "Saving database", 1f); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
public static void Run() { CreateSettingsAssets(); CreateDatabaseAssets(); RegenerateDatabaseAssets(); ProcessorsSettings.Instance.RunDoozyAssetsProcessor = false; ProcessorsSettings.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Saving Processor Settings...", 0.95f); DoozyUtils.SaveAssets(); DoozyUtils.ClearProgressBar(); }
/// <summary> Refresh the entire database by removing empty, duplicate and unnamed entries, sorting the database and updating the names list </summary> /// <param name="showProgress"> Should a progress window be shown while executing the action </param> /// <param name="performUndo"> Record changes? </param> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void RefreshThemeVariants(bool showProgress, bool performUndo, bool saveAssets) { if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 0.1f); } if (performUndo) { UndoRecord(UILabels.RefreshDatabase); } if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 0.2f); } bool addedDefaultColorLabels = ColorLabels.Count == 0; //if the color properties list is empty -> add the default color labels if (addedDefaultColorLabels) { AddDefaultColorLabels(); } if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 0.3f); } bool addedDefaultVariant = AddDefaultVariant(); if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 0.6f); } UpdateVariantsNames(false); if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 0.7f); } if (addedDefaultColorLabels || addedDefaultVariant) { SetDirty(saveAssets); } if (showProgress) { DoozyUtils.DisplayProgressBar(UILabels.ThemeName + ": " + ThemeName, UILabels.RefreshDatabase, 1f); } if (showProgress) { DoozyUtils.ClearProgressBar(); } }
/// <summary> [Editor Only] Performs a deep search through the project for any unregistered ListOfNames asset files and adds them to the database. The search is done only in all the Resources folders. </summary> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void SearchForUnregisteredDatabases(bool saveAssets) { string title = UILabels.Database + ": " + DatabaseType; // ProgressBar Title string info = UILabels.Search; // ProgressBar Info DoozyUtils.DisplayProgressBar(title, info, 0.1f); bool foundUnregisteredDatabase = false; ListOfNames[] array = Resources.LoadAll <ListOfNames>(""); if (array == null || array.Length == 0) { DoozyUtils.ClearProgressBar(); return; } if (Categories == null) { Categories = new List <ListOfNames>(); } for (int i = 0; i < array.Length; i++) { DoozyUtils.DisplayProgressBar(title, info, 0.1f + 0.8f * (i + 1) / array.Length); ListOfNames foundList = array[i]; if (foundList.DatabaseType != DatabaseType) { continue; } if (Categories.Contains(foundList)) { continue; } Categories.Add(foundList); foundUnregisteredDatabase = true; } DoozyUtils.DisplayProgressBar(title, info, 1f); if (!foundUnregisteredDatabase) { DoozyUtils.ClearProgressBar(); return; } UpdateListOfCategoryNames(); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
/// <summary> /// Refreshes the entire database by adding removing empty and null entries, /// sorting the database and updating the category names list. /// </summary> /// <param name="performUndo"> Record changes? </param> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void RefreshDatabase(bool performUndo, bool saveAssets) { string title = UILabels.Database + ": UIPopup"; // ProgressBar Title string info = UILabels.RefreshDatabase; // ProgressBar Info DoozyUtils.DisplayProgressBar(title, info, 0.1f); if (performUndo) { UndoRecord(UILabels.RefreshDatabase); } DoozyUtils.DisplayProgressBar(title, info, 0.4f); RemoveUnreferencedData(false); DoozyUtils.DisplayProgressBar(title, info, 0.8f); Sort(false, false); UpdateListOfPopupNames(); DoozyUtils.DisplayProgressBar(title, info, 1f); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
/// <summary> [Editor Only] Performs a deep search through the project for any unregistered UIPopupLink asset files and adds them to the database. The search is done only in all the Resources folders. </summary> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void SearchForUnregisteredLinks(bool saveAssets) { string title = UILabels.Database + ": UIPopup"; // ProgressBar Title string info = UILabels.Search; // ProgressBar Info DoozyUtils.DisplayProgressBar(title, info, 0.1f); bool foundUnregisteredLink = false; UIPopupLink[] array = Resources.LoadAll <UIPopupLink>(""); if (array == null || array.Length == 0) { DoozyUtils.ClearProgressBar(); return; } if (Popups == null) { Popups = new List <UIPopupLink>(); } for (int i = 0; i < array.Length; i++) { DoozyUtils.DisplayProgressBar(title, info, 0.1f + 0.8f * (i + 1) / array.Length); UIPopupLink link = array[i]; if (Popups.Contains(link)) { continue; } Popups.Add(link); foundUnregisteredLink = true; } DoozyUtils.DisplayProgressBar(title, info, 1f); if (!foundUnregisteredLink) { DoozyUtils.ClearProgressBar(); return; } UpdateListOfPopupNames(); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
/// <summary> [Editor Only] Perform a deep search through the project for any unregistered ThemeData asset files and adds them to the database. The search is done only in all the Resources folders. </summary> /// <param name="saveAssets"> Write all unsaved asset changes to disk? </param> public void SearchForUnregisteredThemes(bool saveAssets) { DoozyUtils.DisplayProgressBar(UILabels.SearchForThemes, UILabels.Search, 0.1f); bool foundUnregisteredThemeData = false; ThemeData[] array = Resources.LoadAll <ThemeData>(""); if (array == null || array.Length == 0) { DoozyUtils.ClearProgressBar(); return; } if (Themes == null) { Themes = new List <ThemeData>(); } for (int i = 0; i < array.Length; i++) { ThemeData foundThemeData = array[i]; DoozyUtils.DisplayProgressBar(UILabels.SearchForThemes, UILabels.Search, 0.1f + 0.1f + 0.7f * (i + 1) / array.Length); if (Themes.Contains(foundThemeData)) { continue; } AddTheme(foundThemeData, false); foundUnregisteredThemeData = true; } if (!foundUnregisteredThemeData) { DoozyUtils.ClearProgressBar(); return; } DoozyUtils.DisplayProgressBar(UILabels.SearchForThemes, UILabels.Search, 0.9f); UpdateThemesNames(); SetDirty(saveAssets); DoozyUtils.ClearProgressBar(); }
private static void CreateDatabaseAssets() { DoozyUtils.ClearProgressBar(); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.1f); UIAnimations.Instance.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.2f); SoundySettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.3f); UIButtonSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.5f); UICanvasSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.7f); UIDrawerSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.8f); UIPopupSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Creating Database Assets...", 0.9f); UIViewSettings.Database.SetDirty(false); DoozyUtils.DisplayProgressBar("Hold On", "Saving Database Assets...", 0.95f); DoozyUtils.SaveAssets(); DoozyUtils.ClearProgressBar(); }