6 using System.Collections.Generic;
16 [Tooltip(
"A tag for finding the theme in the scene")]
17 public string ThemeTag =
"defaultTexture";
19 [Tooltip(
"The target object with the material to swap textures on : optional, leave blank for self")]
26 private Material mMaterial;
28 private string mCheckThemeTag =
"";
35 Target = this.gameObject;
39 Renderer renderer = Target.GetComponent<Renderer>();
43 mMaterial = renderer.material;
44 if (mTextureTheme != null)
51 Debug.LogError(
"A Renderer does not exist on the Target!");
61 if (mTextureTheme == null)
71 mTextureTheme = GetTextureTheme(ThemeTag);
72 mCheckThemeTag = ThemeTag;
92 if (mTextureTheme != null)
94 mMaterial.SetTexture(
"_MainTex", mTextureTheme.
GetThemeValue(state));
100 if(!mCheckThemeTag.Equals(ThemeTag))
110 private void OnDestroy()
112 if (mMaterial != null)
override void SetTheme()
Sets the themes based on the Theme Tags
An Interactive Theme Widget for swapping textures based on interactive state
override void SetState(Interactive.ButtonStateEnum state)
From InteractiveWidget