⚪
Tank & Healer Studio Assets
Return to Website
Ultimate Chat Box
Ultimate Chat Box
  • 🟠Introduction
    • 👋Welcome!
    • ⚡Getting Started
  • 📖Documentation
    • UltimateChatBox
      • Public Methods
        • RegisterChat (+4 overloads)
        • Enable
        • Disable
        • ClearChat
        • EnableInputField
        • ToggleInputField
        • DisableInputField
        • SendCustomInput
        • FindChatsFromUser
        • FindChatsOfStyle
        • UpdatePositioning
      • Events
        • OnChatRegistered
        • OnUsernameHover
        • OnUsernameInteract
        • OnInputFieldUpdated
        • OnInputFieldSubmitted
        • OnInputFieldCommandUpdated
        • OnInputFieldCommandSubmitted
        • OnExtraImageInteract
      • Public Classes
        • ChatInformation
        • ChatStyle
      • Properties
    • UltimateChatBoxStyles
      • Creating a custom Chat Style
  • 💡Tips & Tricks
    • Catching Commands
  • Helpful Links
    • Support Discord
    • Leave us a review!
Powered by GitBook
On this page

Was this helpful?

  1. Documentation
  2. UltimateChatBox
  3. Public Methods

SendCustomInput

Sends custom input to the chat box to process.

using UnityEngine;
using TankAndHealerStudioAssets;

public class ChatBoxExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THESE IN THE INSPECTOR //
	public UltimateChatBox chatBox;
	public RectTransform inputImage;


	void Update ()
	{
		// If the input image is null, then return to avoid errors.
		if( inputImage == null )
			return;
		
		// Modify the input image's position by the horizontal and vertical axis. This example works well with controller input. Although it will work with WASD also.
		inputImage.anchoredPosition += new Vector2( Input.GetAxis( "Horizontal" ), Input.GetAxis( "Vertical" ) );
		
		// Send the custom input data to the chat box to process.
		chatBox.SendCustomInput( inputImage.anchoredPosition, Input.GetButtonDown( "Submit" ), Input.GetButton( "Submit" ) );
	}
}

PreviousDisableInputFieldNextFindChatsFromUser

Last updated 6 months ago

Was this helpful?

📖