OnUsernameHover

This callback is invoked when a username has been hovered in the chat box. Only called when Interactable Usernames is enabled.

Parameters

Vector2

The position of the input when the username was hovered.

ChatInformation

The information about the chat that the input is over.

using UnityEngine;

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


	void Start ()
	{
		chatBox.OnUsernameHover += ( inputPosition, chatInfo ) =>
		{
			print( $"Username: {chatInfo.Username}\nHover Position: {inputPosition}" );
		};

		// OR //

		chatBox.OnUsernameHover += OnUsernameHover;
	}

	void OnUsernameHover ( Vector2 inputPosition, UltimateChatBox.ChatInformation chatInfo )
	{
		print( $"This also works! Username: {chatInfo.Username}\nHover Position: {inputPosition}" );
	}
}

Last updated