private void Start() { var onValueChanged = new TMP_InputField.OnChangeEvent(); onValueChanged.AddListener(InputPlayerSearchChanged); inputPlayerSearch.onValueChanged = onValueChanged; }
/// <summary> /// <para>リスナーを追加します</para> /// <para>この関数は AddListener 関数の省略表記です</para> /// </summary> public static void Add(this TMP_InputField.OnChangeEvent self, UnityAction <string> call) { self.AddListener(call); }
/// <summary> /// リスナーを設定します /// </summary> public static void SetListener(this TMP_InputField.OnChangeEvent self, UnityAction <string> call) { self.RemoveAllListeners(); self.AddListener(call); }
public static void SetTMPInputFieldValueChangedListener(this TMP_InputField tmpInputField, UnityAction <string> callback) { TMP_InputField.OnChangeEvent valueChanged = new TMP_InputField.OnChangeEvent(); valueChanged.AddListener(callback); tmpInputField.onValueChanged = valueChanged; }