centralized interactable
parent
08c16817eb
commit
98c92f4cde
|
@ -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<RectTransform>();
|
||||
_mainInput = _inputRT.GetComponent<InputField>();
|
||||
|
||||
_arrow_Button = _rectTransform.FindChild ("ArrowBtn").GetComponent<Button> ();
|
||||
|
||||
_overlayRT = _rectTransform.FindChild("Overlay").GetComponent<RectTransform>();
|
||||
_overlayRT.gameObject.SetActive(false);
|
||||
|
||||
|
|
|
@ -71,6 +71,17 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
|
||||
public bool interactible
|
||||
{
|
||||
get { return _mainButton.btn.interactable; }
|
||||
set {
|
||||
_mainButton.btn.interactable = value;
|
||||
if (!value && _isPanelActive) {
|
||||
ToggleDropdownPanel (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
Initialize();
|
||||
|
|
Loading…
Reference in New Issue