Breakroom is now Sinewave Campus. Book a meeting

SChatMessage

客户端类型
在此类中SenderID
  1. 属性
  2. SenderID
  3. Sender
  4. Channel
  5. Message
成员 4
属性SenderIDID of the sender of the message
属性SenderName of the sender of the message
属性ChannelName of the channel
属性MessageThe contents of the chat message

属性​

SenderID只读​

uint SenderID {get; }

ID of the sender of the message

示例

Lua
function oc(chatm)
Space.Log(chatm.SenderID)
end
Space.Network.Chat.OnChat(oc)
Lua
--this script processes every new chat message and makes a UIText display the Sender's ID
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime

OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.SenderID
end

Space.Network.Chat.OnChat(OnChatFunction)

Sender只读​

string Sender {get; }

Name of the sender of the message

示例

Lua
function oc(chatm)
Space.Log(chatm.Sender)
end
Space.Network.Chat.OnChat(oc)
Lua
--this script processes every new chat message and makes a UIText display the Sender name
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime

OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Sender
end

Space.Network.Chat.OnChat(OnChatFunction)

Channel只读​

string Channel {get; }

Name of the channel

示例

Lua
function oc(chatm)
Space.Log(chatm.Channel)
end
Space.Network.Chat.OnChat(oc)
Lua
--this script processes every new chat message and makes a UIText display the channel's name
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime

OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Channel
end

Space.Network.Chat.OnChat(OnChatFunction)

Message只读​

string Message {get; }

The contents of the chat message

示例

Lua
function oc(chatm)
Space.Log(chatm.Message)
end
Space.Network.Chat.OnChat(oc)
Lua
--this script processes every new chat message and makes a UIText display the Message
uiText = Space.Host.GetReference("text").UIText --Add this Text object as reference in Scripting Runtime

OnChatFunction = function(SChatMessage)
uiText.Text = SChatMessage.Message
end

Space.Network.Chat.OnChat(OnChatFunction)