Manual

ThemeData

class in Doozy.Engine.Themes / Inherits from ScriptableObject

Description

The ThemeData represents a theme and contains all the data it's comprised of like the properties and theme variants

Properties

  • public ThemeVariantData ActiveVariant – Get the currently active theme variant. If the active variant has not been set, the first variant from the Variants list will get automatically selected

  • public Guid Id  – Id of this theme

  • public string ThemeName – Name of this theme

  • public bool IsGeneralTheme – Returns TRUE if this theme’s name is ‘General’. This is a special theme name as it considered the default theme (it will always exist)

Public Variables

  • public List<LabelIdColorLabels – List of LabelIds for Color properties

  • public List<LabelIdSpriteLabels – List of LabelIds for Sprite properties

  • public List<LabelId> TextureLabels – List of LabelIds for Texture properties

  • public List<LabelId> FontLabels – List of LabelIds for Font properties

  • public List<LabelId> FontAssetLabels – List of LabelIds for FontAsset properties

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

  • public List<ThemeVariantData> Variants – List of the theme variants that this theme has

Constructors

  • public ThemeData() – Construct a new theme with an unique Id

Public Methods

  • public void ActivateVariant(ThemeVariantData variant) – Activate the given variant

  • public void ActivateVariant(Guid variantId) – Activate the given variant by Guid

  • public void ActivateVariant(string variantName) – Activate the given variant by its name

  • public void AddColorProperty(bool performUndo, bool saveAssets = false) – Add a new color property

  • public void AddSpriteProperty(bool performUndo, bool saveAssets = false) – Add a new sprite property

  • public void AddTextureProperty(bool performUndo, bool saveAssets = false) – Add a new texture property

  • public void AddFontProperty(bool performUndo, bool saveAssets = false) – Add a new font property

  • public void AddFontAssetProperty(bool performUndo, bool saveAssets = false) – Add a new font asset property (TextMeshPro font)

  • public void AddVariant(bool performUndo, bool saveAssets = false) – Add a new variant to the theme

  • public bool ContainsColorProperty(Guid propertyId) – Returns TRUE if a Color property, with the given Id, exists in this theme

  • public bool ContainsSpriteProperty(Guid propertyId) – Returns TRUE if a Sprite property, with the given Id, exists in this theme

  • public bool ContainsTextureProperty(Guid propertyId) – Returns TRUE if a Texture property, with the given Id, exists in this theme

  • public bool ContainsFontProperty(Guid propertyId) – Returns TRUE if a Font property, with the given Id, exists in this theme

  • public bool ContainsFontAssetProperty(Guid propertyId) – Returns TRUE if a FontAsset property, with the given Id, exists in this theme

  • public bool ContainsVariant(Guid variantGuid) – Returns TRUE if the variant Guid has been found in the database

  • public bool ContainsVariant(string variantName) – Returns TRUE if the variant name has been found in the database

  • public ThemeVariantData GetVariant(Guid variantId) – Get the variant with the given Guid

  • public ThemeVariantData GetVariant(string variantName) – Get the variant with the given name

  • public int GetColorPropertyIndex(Guid id) – Get the color property index by searching for the given Guid

  • public int GetSpritePropertyIndex(Guid id) – Get the sprite property index by searching for the given Guid

  • public int GetTexturePropertyIndex(Guid id) – Get the texture property index by searching for the given Guid

  • public int GetFontPropertyIndex(Guid id) – Get the font property index by searching for the given Guid

  • public int GetFontAssetPropertyIndex(Guid id) – Get the font asset property index by searching for the given Guid

  • public int GetVariantIndex(Guid id) – Get the variant index by searching for the given Guid

  • public void Init(bool showProgress, bool saveAssets) – Initializes this theme by checking if it has the ‘Default’ variant. If it does not, it adds it

  • public void RemoveColorProperty(Guid deleteGuid, bool performUndo, bool saveAssets) – Remove a color property

  • public void RemoveSpriteProperty(Guid deleteGuid, bool performUndo, bool saveAssets) – Remove a sprite property

  • public void RemoveTextureProperty(Guid deleteGuid, bool performUndo, bool saveAssets) – Remove a texture property

  • public void RemoveFontProperty(Guid deleteGuid, bool performUndo, bool saveAssets) – Remove a font property

  • public void RemoveFontAssetProperty(Guid deleteGuid, bool performUndo, bool saveAssets) – Remove a font asset property

  • public void RefreshThemeVariants(bool showProgress, bool performUndo, bool saveAssets) – Refresh the entire database by removing empty, duplicate and unnamed entries, sorting the database and updating the names list

  • public bool RemoveVariant(ThemeVariantData data, bool performUndo = false, bool showDialog = false, bool saveAssets = false) – Iterate through the database to look for the given variant. If found, removes the entry and returns TRUE

  • 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) – Sort the variants

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

  • public void UpdateVariantsNames(bool saveAssets) – Update the list of theme variants names found in the database