# MirrorComponent

Kind: Class · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
<span>Inherits <a href="/scripting/api/sansar.script/instanceinterface">Sansar.Script.InstanceInterface</a></span>
<span class="api-badge api-since">Added in 47.3.0</span>
</div>

<span id="T:Sansar.Simulation.MirrorComponent"></span>

The MirrorComponent handles interactions with mirrors.

```csharp
public class MirrorComponent : Sansar.Script.InstanceInterface
```

## Members at a glance

| Kind | Members |
|---|---|
| **Fields** | [ComponentType](#componenttype) |
| **Properties** | [ComponentId](#componentid) · [IsScriptable](#isscriptable) · [Name](#name) |
| **Methods** | [GetIsEnabled](#getisenabled) · [SetIsEnabled](#setisenabled) · [ToString](#tostring) |

## Fields

### ComponentType

<div class="api-card">
<span id="F:Sansar.Simulation.MirrorComponent.ComponentType"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public static readonly ComponentType ComponentType
```

The [`MirrorComponent.ComponentType`](/scripting/api/sansar.simulation/mirrorcomponent#componenttype) of this component

</div>


## Properties

### ComponentId

<div class="api-card">
<span id="P:Sansar.Simulation.MirrorComponent.ComponentId"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public Sansar.Script.ComponentId ComponentId { get; }
```

Retrieves the component id for this MirrorComponent.

**Value:** [Sansar.Script.ComponentId](/scripting/api/sansar.script/componentid) — The id.

</div>

### IsScriptable

<div class="api-card">
<span id="P:Sansar.Simulation.MirrorComponent.IsScriptable"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public bool IsScriptable { get; }
```

The scriptable flag for this MirrorComponent.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — Whether or not this mirror can have properties changed by script.

</div>

### Name

<div class="api-card">
<span id="P:Sansar.Simulation.MirrorComponent.Name"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public string Name { get; }
```

This MirrorComponent name, as specified in the editor.

</div>


## Methods

### GetIsEnabled

<div class="api-card">
<span id="M:Sansar.Simulation.MirrorComponent.GetIsEnabled"></span>
<span id="M:Sansar.Simulation.MirrorComponent.GetIsEnabled()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public bool GetIsEnabled()
```

Retrieves the enabled state of this MirrorComponent.

**Returns:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — The enabled state.

</div>

### SetIsEnabled

<div class="api-card" id="setisenabled-boolean">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public void SetIsEnabled(bool isEnabled)
```

Sets the enabled state of this MirrorComponent.

| Parameter | Type | Description |
|---|---|---|
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setisenabled-sessionid-boolean">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(Sansar.Script.SessionId,System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
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](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change mirror state for. |
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |

<details class="api-remarks"><summary>Remarks</summary>

It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.

</details>

</div>

<div class="api-card" id="setisenabled-agentprivate-boolean">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(Sansar.Simulation.AgentPrivate,System.Boolean)"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public void SetIsEnabled(AgentPrivate agent, bool isEnabled)
```

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

| Parameter | Type | Description |
|---|---|---|
| `agent` | [AgentPrivate](/scripting/api/sansar.simulation/agentprivate) | The agent to change mirror state for. |
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |

<details class="api-remarks"><summary>Remarks</summary>

It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.

</details>

</div>

<div class="api-card" id="setisenabled-boolean-action">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public void SetIsEnabled(
    bool isEnabled,
    Action<Sansar.Script.OperationCompleteEvent> handler
)
```

Sets the enabled state of this MirrorComponent.

| Parameter | Type | Description |
|---|---|---|
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

This asynchronous method queues the write then returns. To block until the write has occurred, pass this method to [`ScriptBase.WaitFor`](/scripting/api/sansar.script/scriptbase#waitfor) while in a coroutine.

</details>

</div>

<div class="api-card" id="setisenabled-sessionid-boolean-action">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(Sansar.Script.SessionId,System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
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](/scripting/api/sansar.script/sessionid) | The sessionId of the user to change mirror state for. |
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.

</details>

</div>

<div class="api-card" id="setisenabled-agentprivate-boolean-action">
<span id="M:Sansar.Simulation.MirrorComponent.SetIsEnabled(Sansar.Simulation.AgentPrivate,System.Boolean,System.Action{Sansar.Script.OperationCompleteEvent})"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
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](/scripting/api/sansar.simulation/agentprivate) | The agent to change mirror state for. |
| `isEnabled` | [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The enabled state to set. |
| `handler` | [Action&lt;Sansar.Script.OperationCompleteEvent&gt;](https://learn.microsoft.com/dotnet/api/system.action-1) | Handler to be called when the event completes. |

<details class="api-remarks"><summary>Remarks</summary>

It will only change mirror enabled state for a single user and will not persist across client restarts, server restarts, or leaving the scene.

</details>

</div>

### ToString

<div class="api-card">
<span id="M:Sansar.Simulation.MirrorComponent.ToString"></span>
<span id="M:Sansar.Simulation.MirrorComponent.ToString()"></span>
<div class="api-badges"><span class="api-badge api-since">Added in 47.3.0</span></div>

```csharp signature
public override string ToString()
```

A string representation of this object.

**Returns:** [string](https://learn.microsoft.com/dotnet/api/system.string) — A string representation of this object.

<details class="api-remarks"><summary>Remarks</summary>

The format of this string may change between releases.

</details>

</div>




<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>