Manual

ThemeManager

class in Doozy.Engine.Themes / Inherits from MonoBehaviour

Description

The ThemeManager handles the theme management at runtime

Static Properties

  • public static bool ApplicationIsQuitting – Internal variable used as a flag when the application is quitting

  • public static bool AutoSave – Returns TRUE if the system should automatically save and load, at runtime, the last selected active theme variants

  • public static ThemesDatabase Database – Reference to the global themes database

  • public static readonly Dictionary<Guid, List<ThemeTarget>> ThemeTargets – Internal database used to register all the theme targets to their respective selected theme

Public Methods

  • public ThemeData GetTheme(Guid themeId) – Get the theme with the given theme id. If a theme with the given id is not found in the database, it will return null

  • public ThemeData GetTheme(string themeName) – Get the first theme with the given name. If a theme with the given name is not found in the database, it will return null

  • public ThemeVariantData GetVariant(Guid variantId) – Get the theme variant with the given variant. If a theme variant with the given id is not found in the database, it will return null

  • public ThemeVariantData GetVariant(Guid themeId, Guid variantId) – Get the theme variant with the given variant id. If a theme variant with the given variant id is not found in the target theme, it will return null

  • public ThemeVariantData GetVariant(Guid themeId, string variantName) – Get the theme variant with the given variant name. If a theme variant with the given variant name is not found in the target theme, it will return null

  • public ThemeVariantData GetVariant(string themeName, Guid variantId) – Get the theme variant with the given variant id. If a theme variant with the given variant id is not found in the target theme, it will return null

  • public ThemeVariantData GetVariant(string themeName, string variantName) – Get the theme variant with the given variant name. If a theme variant with the given variant name is not found in the target theme, it will return null

Static Methods

  • public static void ActivateVariant(Guid themeId, Guid variantId) – Activate the variant by id found in the theme with the given id

  • public static void ActivateVariant(Guid themeId, string variantName) – Activate the variant by name found in the theme with the given id

  • public static void ActivateVariant(string themeName, Guid variantId) – Activate the variant by id in the theme with the given name

  • public static void ActivateVariant(string themeName, string variantName) – Activate the variant by name in the theme with the given name

  • public static void ActivateVariant(Guid variantId) – Activate the variant by id. Performs a search through all the registered themes (the entire database)

  • public static void Init() – Initialize the ThemeManager Instance

  • public static void LoadActiveVariant(ThemeData theme) – Loads the active variant of the given theme from the PlayerPrefs

  • public static void RegisterTarget(ThemeTarget target) – Register a theme target to the ThemeManager. If the given theme target does not have a valid ThemeId, it will not get registered

  • public static void SaveActiveVariant(ThemeData theme) – Saves the active variant of the given theme to the PlayerPrefs

  • public static void UnregisterTarget(ThemeTarget target) – Unregister a theme target from the ThemeManager

  • public static void UpdateTargets() – Update all the theme targets registered in the ThemeManager

  • public static void UpdateTargets(ThemeData themeData) – Update all the theme targets registered in the ThemeManager, for the given theme

  • public static void UpdateTargets(Guid themeId) – Update all the theme targets registered in the ThemeManager, for the given theme id