The MirrorComponent handles interactions with mirrors.
public class MirrorComponent : Sansar.Script.InstanceInterfaceMembers at a glance
| Kind | Members |
|---|---|
| Fields | ComponentType |
| Properties | ComponentId · IsScriptable · Name |
| Methods | GetIsEnabled · SetIsEnabled · ToString |
Fields
ComponentType
public static readonly ComponentType ComponentTypeThe MirrorComponent.ComponentType of this component
Properties
ComponentId
public Sansar.Script.ComponentId ComponentId { get; }Retrieves the component id for this MirrorComponent.
Value: Sansar.Script.ComponentId — The id.
IsScriptable
public bool IsScriptable { get; }The scriptable flag for this MirrorComponent.
Value: bool — Whether or not this mirror can have properties changed by script.
Name
public string Name { get; }This MirrorComponent name, as specified in the editor.
Methods
GetIsEnabled
public bool GetIsEnabled()Retrieves the enabled state of this MirrorComponent.
Returns: bool — The enabled state.
SetIsEnabled
public void SetIsEnabled(bool isEnabled)Sets the enabled state of this MirrorComponent.
| Parameter | Type | Description |
|---|---|---|
isEnabled | bool | The enabled state to set. |
Remarks
This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to ScriptBase.WaitFor while in a coroutine.
public void SetIsEnabled(
Sansar.Script.SessionId sessionId,
bool isEnabled
)Sets the enabled state of this MirrorComponent for a single user.
| Parameter | Type | Description |
|---|---|---|
sessionId | Sansar.Script.SessionId | The sessionId of the user to change mirror state for. |
isEnabled | bool | The enabled state to set. |
Remarks
It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
public void SetIsEnabled(AgentPrivate agent, bool isEnabled)Sets the enabled state of this MirrorComponent for a single user.
| Parameter | Type | Description |
|---|---|---|
agent | AgentPrivate | The agent to change mirror state for. |
isEnabled | bool | The enabled state to set. |
Remarks
It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
public void SetIsEnabled(
bool isEnabled,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the enabled state of this MirrorComponent.
| Parameter | Type | Description |
|---|---|---|
isEnabled | bool | The enabled state to set. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to ScriptBase.WaitFor while in a coroutine.
public void SetIsEnabled(
Sansar.Script.SessionId sessionId,
bool isEnabled,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the enabled state of this MirrorComponent for a single user.
| Parameter | Type | Description |
|---|---|---|
sessionId | Sansar.Script.SessionId | The sessionId of the user to change mirror state for. |
isEnabled | bool | The enabled state to set. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
public void SetIsEnabled(
AgentPrivate agent,
bool isEnabled,
Action<Sansar.Script.OperationCompleteEvent> handler
)Sets the enabled state of this MirrorComponent for a single user.
| Parameter | Type | Description |
|---|---|---|
agent | AgentPrivate | The agent to change mirror state for. |
isEnabled | bool | The enabled state to set. |
handler | Action<Sansar.Script.OperationCompleteEvent> | Handler to be called when the event completes. |
Remarks
It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.
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.