⚪
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. Events

OnChatRegistered

This callback is invoked any time a chat is registered to the Ultimate Chat Box.

Parameters

ChatInformation

The information about the chat that was registered.

using UnityEngine;
using TankAndHealerStudioAssets;

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


	void Start ()
	{
		chatBox.OnChatRegistered += ( chatInfo ) =>
   		{
                	print( $"Chat was registered from user: {chatInfo.Username} with this content: {chatInfo.Message}" );
		};
		
		// OR //
		
		chatBox.OnChatRegistered += OnChatRegistered;
	}
	
	void OnChatRegistered ( UltimateChatBox.ChatInformation chatInfo )
	{
		print( $"This also works! Chat registered from user: {chatInfo.Username} with content: {chatInfo.Message}" );
	}
}

PreviousEventsNextOnUsernameHover

Last updated 6 months ago

Was this helpful?

📖