Enables the input field associated with the Ultimate Chat Box. If a string is provided to the function, the input field will be opened with the string value applied.
usingUnityEngine;usingTankAndHealerStudioAssets;publicclassChatBoxExample:MonoBehaviour{ // BE SURE TO ASSIGN THIS IN THE INSPECTOR //publicUltimateChatBox chatBox;voidUpdate () { // If the forward slash key has been pressed...if( Input.GetKeyDown( KeyCode.Slash ) ) { // Enable the input field of the chat box with a default value of /.chatBox.EnableInputField( "/" ); } // Else if the Return key has been pressed and the input field is NOT currently enabled...elseif( Input.GetKeyDown( KeyCode.Return ) &&!chatBox.InputFieldEnabled ) { // Enable the input field.chatBox.EnableInputField(); } }}