OnUsernameInteract
This callback is invoked when a username has been interacted with in the chat box. Only called when Interactable Usernames is enabled.
Parameters
using UnityEngine;
using TankAndHealerStudioAssets;
public class ChatBoxExample : MonoBehaviour
{
// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
public UltimateChatBox chatBox;
void Start ()
{
chatBox.OnUsernameInteract += ( inputPosition, chatInfo ) =>
{
print( $"Username: {chatInfo.Username}\nHover Position: {inputPosition}" );
};
// OR //
chatBox.OnUsernameInteract += OnUsernameInteract;
}
void OnUsernameInteract ( Vector2 inputPosition, UltimateChatBox.ChatInformation chatInfo )
{
print( $"This also works! Username: {chatInfo.Username}\nHover Position: {inputPosition}" );
}
}Last updated