#if UNITY_EDITOR using DTT.Utils.Optimization; using System.IO; using UnityEditor; using UnityEngine; namespace DTT.PublishingTools { /// /// Contains the textures used as part of the DTT styling. /// public static class DTTTextures { #region InnerClasses /// /// Holds the textures used for the Unity light theme. /// public class LightTextures : LazyTexture2DCache { /// /// The light theme logo texture. /// public Texture2D Logo => base[nameof(Logo)]; /// /// The light theme card header texture. /// public Texture2D CardHeader => base[nameof(CardHeader)]; /// /// The light theme card body texture. /// public Texture2D CardBody => base[nameof(CardBody)]; /// /// Initializes the light theme textures. /// public LightTextures() { Add(nameof(Logo), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "logo_dark.png"))); Add(nameof(CardHeader), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "card_header_light.png"))); Add(nameof(CardBody), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "card_body_light.png"))); } } /// /// Holds the textures used for the Unity dark theme. /// public class DarkTextures : LazyTexture2DCache { /// /// The dark theme logo texture. /// public Texture2D Logo => base[nameof(Logo)]; /// /// The dark theme card header texture. /// public Texture2D CardHeader => base[nameof(CardHeader)]; /// /// The dark theme card body texture. /// public Texture2D CardBody => base[nameof(CardBody)]; /// /// Initializes the dark theme textures. /// public DarkTextures() { Add(nameof(Logo), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "logo_light.png"))); Add(nameof(CardHeader), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "card_header_dark.png"))); Add(nameof(CardBody), () => AssetDatabase.LoadAssetAtPath( Path.Combine(DTTEditorConfig.ArtFolder, "card_body_dark.png"))); } } #endregion /// /// The DTT icon, without background. /// public static readonly Texture icon; /// /// Holds the textures used for the Unity light theme. /// public static readonly LightTextures light; /// /// Holds the textures used for the Unity dark theme. /// public static readonly DarkTextures dark; /// /// Loads the textures. /// static DTTTextures() { icon = AssetDatabase.LoadAssetAtPath(Path.Combine(DTTEditorConfig.ArtFolder, "icon-large.png")); light = new LightTextures(); dark = new DarkTextures(); } } } #endif