diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..462d66a --- /dev/null +++ b/README.md.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: a7b682f292cfba6438971b2bc7e90705 +DefaultImporter: + userData: diff --git a/Scripts.meta b/Scripts.meta new file mode 100644 index 0000000..4b89cef --- /dev/null +++ b/Scripts.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 9001b012db436b1438e03cdda2954484 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Scripts/Accordion.meta b/Scripts/Accordion.meta new file mode 100644 index 0000000..c802467 --- /dev/null +++ b/Scripts/Accordion.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 82ea50ac9a6ea8940a71f86ea8d13bf0 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Scripts/Accordion/Accordion.cs b/Scripts/Accordion/Accordion.cs new file mode 100644 index 0000000..7eb3dc4 --- /dev/null +++ b/Scripts/Accordion/Accordion.cs @@ -0,0 +1,41 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + + +namespace UnityEngine.UI.Extensions +{ + [RequireComponent(typeof(VerticalLayoutGroup), typeof(ContentSizeFitter), typeof(ToggleGroup))] + [AddComponentMenu("UI/Extensions/Accordion/Accordion Group")] + public class Accordion : MonoBehaviour + { + + public enum Transition + { + Instant, + Tween + } + + [SerializeField] private Transition m_Transition = Transition.Instant; + [SerializeField] private float m_TransitionDuration = 0.3f; + + /// + /// Gets or sets the transition. + /// + /// The transition. + public Transition transition + { + get { return this.m_Transition; } + set { this.m_Transition = value; } + } + + /// + /// Gets or sets the duration of the transition. + /// + /// The duration of the transition. + public float transitionDuration + { + get { return this.m_TransitionDuration; } + set { this.m_TransitionDuration = value; } + } + } +} \ No newline at end of file diff --git a/Scripts/Accordion/Accordion.cs.meta b/Scripts/Accordion/Accordion.cs.meta new file mode 100644 index 0000000..a82f6a6 --- /dev/null +++ b/Scripts/Accordion/Accordion.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4387cc9950f37044c92f9d144a2b1002 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/Accordion/AccordionElement.cs b/Scripts/Accordion/AccordionElement.cs new file mode 100644 index 0000000..3005e55 --- /dev/null +++ b/Scripts/Accordion/AccordionElement.cs @@ -0,0 +1,138 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + +using System; +using UnityEngine.UI.Extensions.Tweens; + +namespace UnityEngine.UI.Extensions +{ + [RequireComponent(typeof(RectTransform), typeof(LayoutElement))] + [AddComponentMenu("UI/Extensions/Accordion/Accordion Element")] + public class AccordionElement : Toggle + { + + [SerializeField] private float m_MinHeight = 18f; + + private Accordion m_Accordion; + private RectTransform m_RectTransform; + private LayoutElement m_LayoutElement; + + [NonSerialized] + private readonly TweenRunner m_FloatTweenRunner; + + protected AccordionElement() + { + if (this.m_FloatTweenRunner == null) + this.m_FloatTweenRunner = new TweenRunner(); + + this.m_FloatTweenRunner.Init(this); + } + + protected override void Awake() + { + base.Awake(); + base.transition = Transition.None; + base.toggleTransition = ToggleTransition.None; + this.m_Accordion = this.gameObject.GetComponentInParent(); + this.m_RectTransform = this.transform as RectTransform; + this.m_LayoutElement = this.gameObject.GetComponent(); + this.onValueChanged.AddListener(OnValueChanged); + } + + protected override void OnValidate() + { + base.OnValidate(); + + if (this.group == null) + { + ToggleGroup tg = this.GetComponentInParent(); + + if (tg != null) + { + this.group = tg; + } + } + + LayoutElement le = this.gameObject.GetComponent(); + + if (le != null) + { + if (this.isOn) + { + le.preferredHeight = -1f; + } + else + { + le.preferredHeight = this.m_MinHeight; + } + } + } + + public void OnValueChanged(bool state) + { + if (this.m_LayoutElement == null) + return; + + Accordion.Transition transition = (this.m_Accordion != null) ? this.m_Accordion.transition : Accordion.Transition.Instant; + + if (transition == Accordion.Transition.Instant) + { + if (state) + { + this.m_LayoutElement.preferredHeight = -1f; + } + else + { + this.m_LayoutElement.preferredHeight = this.m_MinHeight; + } + } + else if (transition == Accordion.Transition.Tween) + { + if (state) + { + this.StartTween(this.m_MinHeight, this.GetExpandedHeight()); + } + else + { + this.StartTween(this.m_RectTransform.rect.height, this.m_MinHeight); + } + } + } + + protected float GetExpandedHeight() + { + if (this.m_LayoutElement == null) + return this.m_MinHeight; + + float originalPrefH = this.m_LayoutElement.preferredHeight; + this.m_LayoutElement.preferredHeight = -1f; + float h = LayoutUtility.GetPreferredHeight(this.m_RectTransform); + this.m_LayoutElement.preferredHeight = originalPrefH; + + return h; + } + + protected void StartTween(float startFloat, float targetFloat) + { + float duration = (this.m_Accordion != null) ? this.m_Accordion.transitionDuration : 0.3f; + + FloatTween info = new FloatTween + { + duration = duration, + startFloat = startFloat, + targetFloat = targetFloat + }; + info.AddOnChangedCallback(SetHeight); + info.ignoreTimeScale = true; + this.m_FloatTweenRunner.StartTween(info); + } + + protected void SetHeight(float height) + { + if (this.m_LayoutElement == null) + return; + + this.m_LayoutElement.preferredHeight = height; + } + } +} \ No newline at end of file diff --git a/Scripts/Accordion/AccordionElement.cs.meta b/Scripts/Accordion/AccordionElement.cs.meta new file mode 100644 index 0000000..47f1593 --- /dev/null +++ b/Scripts/Accordion/AccordionElement.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c9d341c4bc7de548937508e6f837144 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/Accordion/Editor.meta b/Scripts/Accordion/Editor.meta new file mode 100644 index 0000000..0d10c93 --- /dev/null +++ b/Scripts/Accordion/Editor.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: dc2df01d18eb92b49b30e7403cce8313 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Scripts/Accordion/Editor/AccordionElementEditor.cs b/Scripts/Accordion/Editor/AccordionElementEditor.cs new file mode 100644 index 0000000..29e8d8e --- /dev/null +++ b/Scripts/Accordion/Editor/AccordionElementEditor.cs @@ -0,0 +1,23 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + +using UnityEngine.UI.Extensions; + +namespace UnityEditor.UI +{ + [CustomEditor(typeof(AccordionElement), true)] + public class AccordionElementEditor : ToggleEditor { + + public override void OnInspectorGUI() + { + this.serializedObject.Update(); + EditorGUILayout.PropertyField(this.serializedObject.FindProperty("m_MinHeight")); + this.serializedObject.ApplyModifiedProperties(); + + base.serializedObject.Update(); + EditorGUILayout.PropertyField(base.serializedObject.FindProperty("m_IsOn")); + EditorGUILayout.PropertyField(base.serializedObject.FindProperty("m_Interactable")); + base.serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Scripts/Accordion/Editor/AccordionElementEditor.cs.meta b/Scripts/Accordion/Editor/AccordionElementEditor.cs.meta new file mode 100644 index 0000000..57fbc44 --- /dev/null +++ b/Scripts/Accordion/Editor/AccordionElementEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8882b502b0c65b24ba4623d6a383815b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/Accordion/Tweening.meta b/Scripts/Accordion/Tweening.meta new file mode 100644 index 0000000..9447bb6 --- /dev/null +++ b/Scripts/Accordion/Tweening.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: b9115417252d4cd42a5e167bdc1c2d3b +folderAsset: yes +DefaultImporter: + userData: diff --git a/Scripts/Accordion/Tweening/FloatTween.cs b/Scripts/Accordion/Tweening/FloatTween.cs new file mode 100644 index 0000000..0378300 --- /dev/null +++ b/Scripts/Accordion/Tweening/FloatTween.cs @@ -0,0 +1,121 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + +using System.Collections; +using UnityEngine.Events; + +namespace UnityEngine.UI.Extensions.Tweens +{ + public struct FloatTween : ITweenValue + { + public class FloatTweenCallback : UnityEvent {} + public class FloatFinishCallback : UnityEvent {} + + private float m_StartFloat; + private float m_TargetFloat; + private float m_Duration; + private bool m_IgnoreTimeScale; + private FloatTweenCallback m_Target; + private FloatFinishCallback m_Finish; + + /// + /// Gets or sets the starting float. + /// + /// The start float. + public float startFloat + { + get { return m_StartFloat; } + set { m_StartFloat = value; } + } + + /// + /// Gets or sets the target float. + /// + /// The target float. + public float targetFloat + { + get { return m_TargetFloat; } + set { m_TargetFloat = value; } + } + + /// + /// Gets or sets the duration of the tween. + /// + /// The duration. + public float duration + { + get { return m_Duration; } + set { m_Duration = value; } + } + + /// + /// Gets or sets a value indicating whether this should ignore time scale. + /// + /// true if ignore time scale; otherwise, false. + public bool ignoreTimeScale + { + get { return m_IgnoreTimeScale; } + set { m_IgnoreTimeScale = value; } + } + + /// + /// Tweens the float based on percentage. + /// + /// Float percentage. + public void TweenValue(float floatPercentage) + { + if (!ValidTarget()) + return; + + m_Target.Invoke( Mathf.Lerp (m_StartFloat, m_TargetFloat, floatPercentage) ); + } + + /// + /// Adds a on changed callback. + /// + /// Callback. + public void AddOnChangedCallback(UnityAction callback) + { + if (m_Target == null) + m_Target = new FloatTweenCallback(); + + m_Target.AddListener(callback); + } + + /// + /// Adds a on finish callback. + /// + /// Callback. + public void AddOnFinishCallback(UnityAction callback) + { + if (m_Finish == null) + m_Finish = new FloatFinishCallback(); + + m_Finish.AddListener(callback); + } + + public bool GetIgnoreTimescale() + { + return m_IgnoreTimeScale; + } + + public float GetDuration() + { + return m_Duration; + } + + public bool ValidTarget() + { + return m_Target != null; + } + + /// + /// Invokes the on finish callback. + /// + public void Finished() + { + if (m_Finish != null) + m_Finish.Invoke(); + } + } +} \ No newline at end of file diff --git a/Scripts/Accordion/Tweening/FloatTween.cs.meta b/Scripts/Accordion/Tweening/FloatTween.cs.meta new file mode 100644 index 0000000..1274e38 --- /dev/null +++ b/Scripts/Accordion/Tweening/FloatTween.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e28e1e9e18f7daa4db5d1ac279d6ce66 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/Accordion/Tweening/ITweenValue.cs b/Scripts/Accordion/Tweening/ITweenValue.cs new file mode 100644 index 0000000..7f09a75 --- /dev/null +++ b/Scripts/Accordion/Tweening/ITweenValue.cs @@ -0,0 +1,16 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + +using System.Collections; + +namespace UnityEngine.UI.Extensions.Tweens +{ + internal interface ITweenValue + { + void TweenValue(float floatPercentage); + bool ignoreTimeScale { get; } + float duration { get; } + bool ValidTarget(); + void Finished(); + } +} \ No newline at end of file diff --git a/Scripts/Accordion/Tweening/ITweenValue.cs.meta b/Scripts/Accordion/Tweening/ITweenValue.cs.meta new file mode 100644 index 0000000..ac402be --- /dev/null +++ b/Scripts/Accordion/Tweening/ITweenValue.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9edf9da4c14ad2843879a2331b00f738 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/Accordion/Tweening/TweenRunner.cs b/Scripts/Accordion/Tweening/TweenRunner.cs new file mode 100644 index 0000000..3a0fe8f --- /dev/null +++ b/Scripts/Accordion/Tweening/TweenRunner.cs @@ -0,0 +1,63 @@ +///Credit ChoMPHi +///Sourced from - http://forum.unity3d.com/threads/accordion-type-layout.271818/ + +using System.Collections; + +namespace UnityEngine.UI.Extensions.Tweens +{ + // Tween runner, executes the given tween. + // The coroutine will live within the given + // behaviour container. + internal class TweenRunner where T : struct, ITweenValue + { + protected MonoBehaviour m_CoroutineContainer; + protected IEnumerator m_Tween; + + // utility function for starting the tween + private static IEnumerator Start(T tweenInfo) + { + if (!tweenInfo.ValidTarget()) + yield break; + + float elapsedTime = 0.0f; + while (elapsedTime < tweenInfo.duration) + { + elapsedTime += tweenInfo.ignoreTimeScale ? Time.unscaledDeltaTime : Time.deltaTime; + var percentage = Mathf.Clamp01 (elapsedTime / tweenInfo.duration); + tweenInfo.TweenValue (percentage); + yield return null; + } + tweenInfo.TweenValue (1.0f); + tweenInfo.Finished(); + } + + public void Init(MonoBehaviour coroutineContainer) + { + m_CoroutineContainer = coroutineContainer; + } + + public void StartTween(T info) + { + if (m_CoroutineContainer == null) + { + Debug.LogWarning ("Coroutine container not configured... did you forget to call Init?"); + return; + } + + if (m_Tween != null) + { + m_CoroutineContainer.StopCoroutine (m_Tween); + m_Tween = null; + } + + if (!m_CoroutineContainer.gameObject.activeInHierarchy) + { + info.TweenValue(1.0f); + return; + } + + m_Tween = Start (info); + m_CoroutineContainer.StartCoroutine (m_Tween); + } + } +} \ No newline at end of file diff --git a/Scripts/Accordion/Tweening/TweenRunner.cs.meta b/Scripts/Accordion/Tweening/TweenRunner.cs.meta new file mode 100644 index 0000000..a890a05 --- /dev/null +++ b/Scripts/Accordion/Tweening/TweenRunner.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d00ab96853b24074cb837ee70f07dddc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/BestFitOutline.cs b/Scripts/BestFitOutline.cs new file mode 100644 index 0000000..ae202ed --- /dev/null +++ b/Scripts/BestFitOutline.cs @@ -0,0 +1,50 @@ +/// Credit Melang +/// Sourced from - http://forum.unity3d.com/members/melang.593409/ + +using System.Collections.Generic; +namespace UnityEngine.UI.Extensions +{ + [AddComponentMenu("UI/Effects/Extensions/BestFit Outline")] + public class BestFitOutline : Shadow + { + // + // Constructors + // + protected BestFitOutline () + { + } + + // + // Methods + // + public override void ModifyVertices (List verts) + { + if (!this.IsActive ()) + { + return; + } + + Text foundtext = GetComponent(); + + float best_fit_adjustment = 1f; + + if (foundtext && foundtext.resizeTextForBestFit) + { + best_fit_adjustment = (float)foundtext.cachedTextGenerator.fontSizeUsedForBestFit / (foundtext.resizeTextMaxSize-1); //max size seems to be exclusive + } + + int start = 0; + int count = verts.Count; + base.ApplyShadow (verts, base.effectColor, start, verts.Count, base.effectDistance.x*best_fit_adjustment, base.effectDistance.y*best_fit_adjustment); + start = count; + count = verts.Count; + base.ApplyShadow (verts, base.effectColor, start, verts.Count, base.effectDistance.x*best_fit_adjustment, -base.effectDistance.y*best_fit_adjustment); + start = count; + count = verts.Count; + base.ApplyShadow (verts, base.effectColor, start, verts.Count, -base.effectDistance.x*best_fit_adjustment, base.effectDistance.y*best_fit_adjustment); + start = count; + count = verts.Count; + base.ApplyShadow (verts, base.effectColor, start, verts.Count, -base.effectDistance.x*best_fit_adjustment, -base.effectDistance.y*best_fit_adjustment); + } + } +} diff --git a/Scripts/BestFitOutline.cs.meta b/Scripts/BestFitOutline.cs.meta new file mode 100644 index 0000000..81e66f6 --- /dev/null +++ b/Scripts/BestFitOutline.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7b30dd83a12669d4f973ff5a79ca9842 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/CanvasGroupActivator.cs b/Scripts/CanvasGroupActivator.cs new file mode 100644 index 0000000..37677b8 --- /dev/null +++ b/Scripts/CanvasGroupActivator.cs @@ -0,0 +1,116 @@ +/// Credit dakka +/// Sourced from - http://forum.unity3d.com/threads/scripts-useful-4-6-scripts-collection.264161/#post-1752415 +/// Notes - Mod from Yilmaz Kiymaz's editor scripts presentation at Unite 2013 +/// Updated ddreaper - removed Linq use, not required. + +using UnityEditor; + +namespace UnityEngine.UI.Extensions +{ + public class CanvasGroupActivator : EditorWindow + { + [MenuItem("Window/UI/Extensions/Canvas Groups Activator")] + public static void InitWindow() + { + EditorWindow.GetWindow(); + } + + CanvasGroup[] canvasGroups; + + void OnEnable() + { + ObtainCanvasGroups(); + } + + void OnFocus() + { + ObtainCanvasGroups(); + } + + void ObtainCanvasGroups() + { + canvasGroups = GameObject.FindObjectsOfType(); + } + + void OnGUI() + { + if (canvasGroups == null) + { + return; + } + + GUILayout.Space(10f); + GUILayout.Label("Canvas Groups"); + + for (int i = 0; i < canvasGroups.Length; i++) + { + if (canvasGroups[i] == null) { continue; } + + bool initialActive = false; + if (canvasGroups[i].alpha == 1.0f) + initialActive = true; + + bool active = EditorGUILayout.Toggle(canvasGroups[i].name, initialActive); + if (active != initialActive) + { + //If deactivated and initially active + if (!active && initialActive) + { + //Deactivate this + canvasGroups[i].alpha = 0f; + canvasGroups[i].interactable = false; + canvasGroups[i].blocksRaycasts = false; + } + //If activated and initially deactive + else if (active && !initialActive) + { + //Deactivate all others and activate this + HideAllGroups(); + + canvasGroups[i].alpha = 1.0f; + canvasGroups[i].interactable = true; + canvasGroups[i].blocksRaycasts = true; + } + } + } + + GUILayout.Space(5f); + + if (GUILayout.Button("Show All")) + { + ShowAllGroups(); + } + + if (GUILayout.Button("Hide All")) + { + HideAllGroups(); + } + } + + void ShowAllGroups() + { + foreach (var group in canvasGroups) + { + if (group != null) + { + group.alpha = 1.0f; + group.interactable = true; + group.blocksRaycasts = true; + } + } + } + + void HideAllGroups() + { + foreach (var group in canvasGroups) + { + if (group != null) + { + group.alpha = 0; + group.interactable = false; + group.blocksRaycasts = false; + } + } + } + } +} diff --git a/Scripts/CanvasGroupActivator.cs.meta b/Scripts/CanvasGroupActivator.cs.meta new file mode 100644 index 0000000..97588ca --- /dev/null +++ b/Scripts/CanvasGroupActivator.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f60a419e63d329f43ba1bf57e98b34bf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/ComboBox.meta b/Scripts/ComboBox.meta new file mode 100644 index 0000000..312445c --- /dev/null +++ b/Scripts/ComboBox.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: 726a11b8d64fa0143b34f417f5453f80 +folderAsset: yes +DefaultImporter: + userData: diff --git a/Scripts/ComboBox/ClickBtn.cs b/Scripts/ComboBox/ClickBtn.cs new file mode 100644 index 0000000..a06f2e5 --- /dev/null +++ b/Scripts/ComboBox/ClickBtn.cs @@ -0,0 +1,13 @@ +///Credit perchik +///Sourced from - http://forum.unity3d.com/threads/receive-onclick-event-and-pass-it-on-to-lower-ui-elements.293642/ + +using UnityEngine; +using System.Collections; + +public class ClickBtn : MonoBehaviour +{ + public void Click() + { + Debug.Log("Clicked"); + } +} diff --git a/Scripts/ComboBox/ClickBtn.cs.meta b/Scripts/ComboBox/ClickBtn.cs.meta new file mode 100644 index 0000000..f15ec30 --- /dev/null +++ b/Scripts/ComboBox/ClickBtn.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33a5d65e2f7d10648af0fde6d2de99cc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Scripts/ComboBox/ComboBox.cs b/Scripts/ComboBox/ComboBox.cs new file mode 100644 index 0000000..984295f --- /dev/null +++ b/Scripts/ComboBox/ComboBox.cs @@ -0,0 +1,625 @@ +///Credit perchik +///Sourced from - http://forum.unity3d.com/threads/receive-onclick-event-and-pass-it-on-to-lower-ui-elements.293642/ + +using System.Collections.Generic; +using System.Linq; + +namespace UnityEngine.UI.Extensions +{ + [RequireComponent(typeof(RectTransform))] + [AddComponentMenu("UI/Extensions/ComboBox")] + public class ComboBox : MonoBehaviour + { + #region declarations + #region private members + + private bool _isActive = false; //is the drop down panel active + + private Button comboBtn; + private Image comboBtnImg; + private Text comboBtnText; + + private Button overlayBtn; + + private GridLayoutGroup itemLayout; + + + private float _scrollbarWidth = 20.0f; + + private int scrollOffset; //offset of the selected item + + private int _itemsToDisplay = 4; //how many items to show in the dropdown panel + + private bool _hideFirstItem = false; //lets us hide the prompt after something is chosen + + private int _selectedIndex = 0; + + private List _items; //conceptual items in the list + + private bool _interactable = true; + + private Canvas _canvas; + + #region private rect transforms + /// All of these have to be properties so that the editor script can access them + + private RectTransform _overlay; //overlayRT is a screensized box to handle clicks *not* on the button. (although this might have to change with multiple things on the screen. + private RectTransform overlayRT + { + get + { + if (_overlay == null) + { + _overlay = rectTransform.FindChild("Overlay").GetComponent(); + overlayBtn = _overlay.gameObject.GetComponent