From 98c92f4cde6141e3b698b3befefee15de8912dc4 Mon Sep 17 00:00:00 2001 From: "LARS-LAPTOP2\\larsme" Date: Mon, 27 Mar 2017 12:03:05 +0200 Subject: [PATCH] centralized interactable --- .../Controls/ComboBox/AutoCompleteComboBox.cs | 17 ++++++++++++++++- Scripts/Controls/ComboBox/DropDownList.cs | 11 +++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs b/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs index 41642f0..fefe5ea 100644 --- a/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs +++ b/Scripts/Controls/ComboBox/AutoCompleteComboBox.cs @@ -24,6 +24,7 @@ namespace UnityEngine.UI.Extensions private InputField _mainInput; private RectTransform _inputRT; + private Button _arrow_Button; private RectTransform _rectTransform; @@ -73,7 +74,19 @@ namespace UnityEngine.UI.Extensions RedrawPanel(); } } - + + public bool interactible + { + get { return _mainInput.interactable || _arrow_Button.interactable; } + set { + _mainInput.interactable = value; + _arrow_Button.interactable = value; + if (!value && _isPanelActive) { + ToggleDropdownPanel (false); + } + } + } + public void Awake() { Initialize(); @@ -88,6 +101,8 @@ namespace UnityEngine.UI.Extensions _inputRT = _rectTransform.FindChild("InputField").GetComponent(); _mainInput = _inputRT.GetComponent(); + _arrow_Button = _rectTransform.FindChild ("ArrowBtn").GetComponent