Class Command
Chat Commands are commands users can execute by typing /[command name]
In the examples, we have a Chat command /ping that tells a user their
Optionally you can set CallFunctionThenSendMessage to true, which will: remove the /command from the message, execute that command, then send the message over the network.
In the examples, we have a chat command /[channel] that changes the chat channel then sends the message. So a user can type /say hi all! and it will change the active channel to the "Say" channel then send the message "hi all!" over the network on that channel.
That setup is as follows:
Name = "say"
CallFunctionThenSendMessage = true
Function to call = A Unity Event that changes the chat channel
Inheritance
Inherited Members
Namespace: LlamaSoftware.Chat.UI
Assembly: LlamaSoftware.Chat.dll
Syntax
[Serializable]
public class Command
Fields
CallFunctionThenSendMessage
If this is true, the "/Name" part of the message will be stripped out, then sent after FunctionToCall.Invoke() is called.
For example: Name = say CallFunctionThenSendMessage = true FunctionToCall set to change chat channel to the /say channel, then the user types "/say hello", the chat channel will be changed to the "say" channel and the message "hello" will be sent over the network on that channel.
Declaration
public bool CallFunctionThenSendMessage
Field Value
Type | Description |
---|---|
System.Boolean |
FunctionToCall
Function to call for the command. CallFunctionThenSendMessage modifies the behavior.
Declaration
public UnityEvent FunctionToCall
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent |
Name
Name of the command. Users will type /Name to execute the command
Declaration
public string Name
Field Value
Type | Description |
---|---|
System.String |