# InstanceInterface

Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.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.Script">Namespace <a href="/scripting/api/sansar.script"><code>Sansar.Script</code></a></span>
</div>

<span id="T:Sansar.Script.InstanceInterface"></span>

Base class for all Sansar Script Object Oriented C\# interfaces.

```csharp
public class InstanceInterface
```

## Remarks

Internal.

## Members at a glance

| Kind | Members |
|---|---|
| **Properties** | [IsValid](#isvalid) |
| **Operators** | [op\_Implicit](#op_implicit) |

## Properties

### IsValid

<div class="api-card">
<span id="P:Sansar.Script.InstanceInterface.IsValid"></span>

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

Whether or not this interface is valid.

**Value:** [bool](https://learn.microsoft.com/dotnet/api/system.boolean) — True if this interface is valid

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

This function is provided for debugging and convenience only. Scripts are frequently &quot;force yielded&quot;, which means there is still the (rare) possibility that on the line after checking IsValid the interface could become invalid. It is highly recommended to &quot;program defensively&quot; and wrap the use of volatile interfaces, like AgentPrivate, in try/catch blocks. Once an interface becomes invalid it will never again become valid. Attempting to call any method on an invalid interface may throw an exception.

</details>

</div>


## Operators

### op_Implicit

<div class="api-card">
<span id="M:Sansar.Script.InstanceInterface.op_Implicit(Sansar.Script.InstanceInterface)~System.IntPtr"></span>

```csharp signature
public static implicit operator IntPtr(InstanceInterface instance)
```

Internal use only.

| Parameter | Type | Description |
|---|---|---|
| `instance` | [InstanceInterface](/scripting/api/sansar.script/instanceinterface) |  |

**Returns:** [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr)

</div>




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