Chat system built on unity Netcode for GameObjects with command and voting support
- Textmeshpro
- Netcode for GameObjects
In ChatHandler
prefab you can see these options
- SystemMessageColor - when the system sends a message, the nickname is displayed in this color
- OwnerMessageColor - when a user sends a message, his nickname is displayed in this color
- ShowOnJoinMessage - should the system notify everyone about the user joining
- ShowOnLeaveMessage - should the system notify everyone about the user leaving
- OnJoinMessage - message after user nickname on join
- OnOnLeaveMessage - message after user nickname on leave
In Example
folder you can see ExampleScene
scene.
To test, you have to build the project twice with different "IsHost" parameters.
Or use the ParrelSync extension and modify the Example
script like this
Before:
private void Start()
{
if (_isHost == false)
{
NetworkManager.Singleton.StartClient();
return;
}
//...
//...
//...
}
After:
private void Start()
{
if (ClonesManager.GetArgument() == "client")
_isHost = false;
else
_isHost = true;
if (_isHost == false)
{
NetworkManager.Singleton.StartClient();
return;
}
//...
//...
//...
}