Learn / Documentation / Script Reference / ThemesDatabase
Manual

ThemesDatabase

class in Doozy.Engine.Themes / Inherits from ScriptableObject

Description

The ThemesDatabase is a global themes database that contains references to ThemeData assets, used by the theme management system to keep track and retrieve all the registered themes

Public Variables

  • public List<string> ThemesNames – List of all the theme names found in this database

  • public List<ThemeData> Themes – List of references to all the ThemeData assets that make up this database

Public Methods

  • public bool AddTheme(ThemeData themeData, bool saveAssets) – Add the given ThemeData reference to this database. Returns TRUE if the operation was successful

  • public bool Contains(Guid themeGuid) – Returns TRUE if a ThemeData reference, with the given theme Guid, has been found in the database

  • public bool Contains(string themeName) – Returns TRUE if a ThemeData reference, with the given theme name, has been found in the database

  • public bool CreateTheme(string themeName, bool showDialog = false, bool saveAssets = false) – Creates a new ThemeData asset with the given theme name and adds a reference to it to the database

  • public bool DeleteThemeData(ThemeData themeData) – Remove the given ThemeData reference from the database and also deletes its corresponding asset file. Returns TRUE if the operation was successful

  • public ThemeData GetThemeData(Guid themeGuid) – Get the ThemeData reference by searching through the database to look for the theme with the given id. If a theme with the given id is not found, it will return null

  • public ThemeData GetThemeData(string themeName) – Get the ThemeData reference by searching through the database to look for the first theme with the given theme name. If a theme with the given name is not found, it will return null

  • public int GetThemeIndex(Guid id) – Get the theme index by Guid

  • public ThemeVariantData GetVariant(Guid variantId) – Get the ThemeVariantData by Guid

  • public void Initialize() – Add the ‘General’ theme if it does not exist and initializes it

  • public bool ContainsTheme(string themeName) – Returns TRUE if the database contains at least one theme with the given name

  • public void InitializeThemes() – Remove any null references and initialize all the referenced ThemeData found in the database

  • public void RefreshDatabase(bool performUndo = true, bool saveAssets = false) – Initialize the database and perform a refresh on all the referenced ThemeData assets

  • public void RemoveDuplicates(bool performUndo, bool saveAssets = false) – Remove any duplicate entries found in the database

  • public bool RemoveNullDatabases(bool saveAssets = false) – Remove any null references from the database

  • public bool RenameThemeData(ThemeData themeData, string newThemeName) – Rename a ThemeData database name (including the asset filename). Returns TRUE if the operation was successful

  • public bool ResetDatabase() – Reset the database to the default values

  • public void SearchForUnregisteredThemes(bool saveAssets) – [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

  • public void SetDirty(bool saveAssets) – [Editor Only] Mark target object as dirty. (Only suitable for non-scene objects)

  • public void Sort(bool performUndo, bool saveAssets = false) – Sort the entire database

  • public void UndoRecord(string undoMessage) – [Editor Only] Record any changes done on the object after this function

  • public void UpdateThemesNames(bool saveAssets = false) – Update the list of ThemeData names found in the database

Static Methods

  • public static string[] GetThemesNames(ThemesDatabase database) – Get a string array of all the theme names found in the database

  • public static string[] GetVariantNames(ThemeData themeData) – Get a string array of all the variant names found in a theme

  • public static string GetThemeDataFilename(string themeName) – Returns a proper formatted filename for a given theme name