Skip to content

Get Sansar

Script API

MirrorComponent

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Simulation Inherits Sansar.Script.InstanceInterface Added in 47.3.0

The MirrorComponent handles interactions with mirrors.

public class MirrorComponent : Sansar.Script.InstanceInterface

Members at a glance

KindMembers
FieldsComponentType
PropertiesComponentId · IsScriptable · Name
MethodsGetIsEnabled · SetIsEnabled · ToString

Fields

ComponentType

Added in 47.3.0
public static readonly ComponentType ComponentType

The MirrorComponent.ComponentType of this component

Properties

ComponentId

Added in 47.3.0
public Sansar.Script.ComponentId ComponentId { get; }

Retrieves the component id for this MirrorComponent.

Value: Sansar.Script.ComponentId — The id.

IsScriptable

Added in 47.3.0
public bool IsScriptable { get; }

The scriptable flag for this MirrorComponent.

Value: bool — Whether or not this mirror can have properties changed by script.

Name

Added in 47.3.0
public string Name { get; }

This MirrorComponent name, as specified in the editor.

Methods

GetIsEnabled

Added in 47.3.0
public bool GetIsEnabled()

Retrieves the enabled state of this MirrorComponent.

Returns: bool — The enabled state.

SetIsEnabled

Added in 47.3.0
public void SetIsEnabled(bool isEnabled)

Sets the enabled state of this MirrorComponent.

ParameterTypeDescription
isEnabledboolThe 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.

Added in 47.3.0
public void SetIsEnabled(     Sansar.Script.SessionId sessionId,     bool isEnabled )

Sets the enabled state of this MirrorComponent for a single user.

ParameterTypeDescription
sessionIdSansar.Script.SessionIdThe sessionId of the user to change mirror state for.
isEnabledboolThe 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.

Added in 47.3.0
public void SetIsEnabled(AgentPrivate agent, bool isEnabled)

Sets the enabled state of this MirrorComponent for a single user.

ParameterTypeDescription
agentAgentPrivateThe agent to change mirror state for.
isEnabledboolThe 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.

Added in 47.3.0
public void SetIsEnabled(     bool isEnabled,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the enabled state of this MirrorComponent.

ParameterTypeDescription
isEnabledboolThe enabled state to set.
handlerAction<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.

Added in 47.3.0
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.

ParameterTypeDescription
sessionIdSansar.Script.SessionIdThe sessionId of the user to change mirror state for.
isEnabledboolThe enabled state to set.
handlerAction<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.

Added in 47.3.0
public void SetIsEnabled(     AgentPrivate agent,     bool isEnabled,     Action<Sansar.Script.OperationCompleteEvent> handler )

Sets the enabled state of this MirrorComponent for a single user.

ParameterTypeDescription
agentAgentPrivateThe agent to change mirror state for.
isEnabledboolThe enabled state to set.
handlerAction<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

Added in 47.3.0
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.