/* * @author Valentin Simonov / http://va.lent.in/ */ using UnityEngine; namespace TouchScript.Behaviors.Cursors.UI { /// /// A helper class to turn on and off without causing allocations. /// [HelpURL("http://touchscript.github.io/docs/html/T_TouchScript_Behaviors_Cursors_UI_TextureSwitch.htm")] public class TextureSwitch : MonoBehaviour { private CanvasRenderer r; /// /// Shows this instance. /// public void Show() { r.SetAlpha(1); } /// /// Hides this instance. /// public void Hide() { r.SetAlpha(0); } private void Awake() { r = GetComponent(); } } }