namespace UIWidgets.Examples
{
using UIWidgets;
using UnityEngine;
using UnityEngine.UI;
///
/// Disable Combobox input.
///
[RequireComponent(typeof(Combobox))]
[System.Obsolete]
public class ComboboxDisableDefaultInput : MonoBehaviour
{
///
/// Disable combobox input.
///
protected virtual void Start()
{
// disable default combobox input, this also disable input field
var combobox = GetComponent();
combobox.Init();
combobox.Editable = false;
// enable input field back
var adapter = GetComponent();
if (adapter != null)
{
adapter.interactable = true;
}
else
{
var input = GetComponent();
if (input != null)
{
input.interactable = true;
}
}
}
}
}