How to use the “On Value Change” in Unity3D Input Field UI component

后端 未结 2 1785
说谎
说谎 2021-01-05 15:44

I\'m following a tutorial on how to work with Unity3d and I\'ve hit a dead end.

I believe something changed in a newer version of Unity since the tutorial seems to w

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 16:33

    Yes you can add event handlers via the inspector. Select the InputField game object and scroll down to the bottom of the InputField section in the inspector. Click + to add a new event handler then select the receiving game object and method you want to call.

    Use the Dynamic string version of the function to pass the input string as a parameter. The Static Parameters callbacks let you set the function parameter in the inspector, which likely isn't what you want when responding to InputField changes.

    enter image description here

提交回复
热议问题