Hide
OnInputField*
Important
Enable SaintsEditor before using

This is a method decorator, which will bind this method to the target TMP_InputField's related event:

  • OnInputFieldChanged
  • OnInputFieldEndEdit
  • OnInputFieldSelect
  • OnInputFieldDeselect

Parameters:

  • string buttonTarget=null the target button. null to get it form the current target.
  • object value=null the value passed to the method. Note unity only support bool, int, float, string and UnityEngine.Object. To pass a UnityEngine.Object, use a string name of the target, and set the isCallback parameter to true
  • bool isCallback=false: when value is a string, set this to true to obtain the actual value from a method/property/field
// Please ensure you already have SaintsEditor enabled in your project before trying this example using SaintsField; [OnInputFieldEndEdit] // bind a void public void InputFieldEndEdit() { Debug.Log("InputFieldEndEdit Void"); } [OnInputFieldChanged] // bind to receive the value public void OnInputFieldChanged(string value) { Debug.Log(
quot;InputFieldChanged
{value}"); } [OnInputFieldSelect(value: "My Custom String")] // bind with a static value callback public void OtherMethodStr(string str) { Debug.Log(
quot;OtherMethod
{str}"); } [GetInSiblings] public TMP_InputField inputField; public TMP_InputField GetMyInputField() => inputField; [OnInputFieldDeselect(nameof(GetMyInputField))] // taget is a callback (support field/property/function) public void BindFromOtherTarget(string val) { Debug.Log(
quot;BindFromOtherTarget
{val}"); }

It'll display a UI that where the event is binded

image