2using System.Collections.Generic;
4using UnityEngine.EventSystems;
14 public override void OnCancel(BaseEventData eventData)
43 UnityEngine.Object.Destroy(
bl.gameObject);
46 base.DestroyBlocker(blocker);
49 public void SetList<TValue>(
string name, IList<TValue> list, Func<TValue, int, string> getName, Action<int, TValue> onChange,
bool notify =
true)
52 for (
int i = 0; i < list.Count; i++)
54 if (getName(list[i], i) == name)
60 SetList(index, list, getName, onChange, notify);
63 public void SetList<TValue>(
int _index, IList<TValue> list, Func<TValue, int, string> getName, Action<int, TValue> onChange,
bool notify =
true)
66 for (
int i = 0; i < list.Count; i++)
68 base.options.Add(
new OptionData
70 text = getName(list[i], i)
73 base.onValueChanged.RemoveAllListeners();
74 base.onValueChanged.AddListener(delegate(
int a)
84 SetValueWithoutNotify(_index);
91 if (base.value < base.options.Count - 1)
static UIDropdown activeInstance
void SetList< TValue >(string name, IList< TValue > list, Func< TValue, int, string > getName, Action< int, TValue > onChange, bool notify=true)
override void DestroyBlocker(GameObject blocker)
override GameObject CreateBlocker(Canvas rootCanvas)
override void OnCancel(BaseEventData eventData)