> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksscriptasset.md).

# Class ksScriptAsset

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

Base class for scripts that can be loaded from assets.

```csharp
public class ksScriptAsset
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksScriptAsset](/reactor/api-reference/ks.reactor/ks.reactor.ksscriptasset.md)

#### Derived

[ksCollisionFilter](/reactor/api-reference/ks.reactor/ks.reactor.kscollisionfilter.md), [ksPlayerController](/reactor/api-reference/ks.reactor/ks.reactor.ksplayercontroller.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Properties

### AssetId <a href="#ks_reactor_ksscriptasset_assetid" id="ks_reactor_ksscriptasset_assetid"></a>

The id of the asset. Zero means it is not an asset.

```csharp
public uint AssetId { get; }
```

#### Property Value

[uint](https://learn.microsoft.com/dotnet/api/system.uint32)

### AssetName <a href="#ks_reactor_ksscriptasset_assetname" id="ks_reactor_ksscriptasset_assetname"></a>

The name of the asset. This is the part of the [AssetPath](#KS_Reactor_ksScriptAsset_AssetPath) after the last '/'.

```csharp
public string AssetName { get; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### AssetPath <a href="#ks_reactor_ksscriptasset_assetpath" id="ks_reactor_ksscriptasset_assetpath"></a>

The asset path.

```csharp
public string AssetPath { get; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

### Assets <a href="#ks_reactor_ksscriptasset_assets" id="ks_reactor_ksscriptasset_assets"></a>

Asset loader singleton. Set this to supply a custom asset loader.

```csharp
public static ksBaseAssetLoader Assets { get; set; }
```

#### Property Value

[ksBaseAssetLoader](/reactor/api-reference/ks.reactor/ks.reactor.ksbaseassetloader.md)

### IsPrefab <a href="#ks_reactor_ksscriptasset_isprefab" id="ks_reactor_ksscriptasset_isprefab"></a>

Is this a prefab asset? If true, this is the asset returned by [Get%60%601](/reactor/api-reference/ks.reactor/ks.reactor.ksbaseassetloader.md#KS_Reactor_ksBaseAssetLoader_Get_60_601_System_UInt32_2cSystem_Boolean_).

```csharp
public bool IsPrefab { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### Clone() <a href="#ks_reactor_ksscriptasset_clone" id="ks_reactor_ksscriptasset_clone"></a>

Creates a copy of the script with the value of all members tagged with ksEditable or ksCloneable copied. Arrays, lists, and dictionaries are cloned. Other object references will reference the same object.

```csharp
public virtual ksScriptAsset Clone()
```

#### Returns

[ksScriptAsset](/reactor/api-reference/ks.reactor/ks.reactor.ksscriptasset.md)

### \~ksScriptAsset() <a href="#ks_reactor_ksscriptasset_finalize" id="ks_reactor_ksscriptasset_finalize"></a>

Removes the asset from the cache when it is garbage collected.

```csharp
protected ~ksScriptAsset()
```
