The AgentPublic class is a more limited subset of the AgentPrivate API for use by other scripts in the scene.
public class AgentPublic : Sansar.Script.InstanceInterfaceRemarks
AgentPublic has a more limited API than AgentPrivate. Agents may leave the scene at any time. Attempting to use an AgentPublic interface for an agent no longer in the scene will throw a NullReferenceException.
Members at a glance
| Kind | Members |
|---|---|
| Properties | AgentInfo |
| Methods | SendChat · ToString |
Properties
AgentInfo
public AgentInfo AgentInfo { get; }Returns the AgentInfo for this instance.
Value: AgentInfo — The AgentInfo for this instance
Remarks
The AgentInfo holds information about an agent.
Methods
SendChat
public void SendChat(string message)Sends a String message to the $className$.
| Parameter | Type | Description |
|---|---|---|
message | string | The message to send. |
Throws NullReferenceException: If the user is no longer online.
Throws ThrottleException: If the throttle rate is exceeded.
Remarks
eprecated. Use AgentPrivate.SendChat or AgentPublic.SendChat
public void SendChat(
string message,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sends a String message to the AgentPublic.
| Parameter | Type | Description |
|---|---|---|
message | string | The message to send. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
Messages may be throttled and ignored.
ToString
public override string ToString()A string representation of this object.
Returns: string — A string representation of this object.
Remarks
The format of this string may change between releases.
Generated from the Sansar 47.10.0 client ScriptApi snapshot.