> 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.client.unity/ks.reactor.client.unity.ksprefabcache.md).

# Class ksPrefabCache

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

Manages caching and loading and entity prefabs.

```csharp
public class ksPrefabCache
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksPrefabCache](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksprefabcache.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)

## Methods

### GetEntityType(uint) <a href="#ks_reactor_client_unity_ksprefabcache_getentitytype_system_uint32" id="ks_reactor_client_unity_ksprefabcache_getentitytype_system_uint32"></a>

Gets the entity type for an asset ID.

```csharp
public string GetEntityType(uint assetId)
```

#### Parameters

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

Asset ID

#### Returns

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

Entity type

### GetPrefab(uint, string) <a href="#ks_reactor_client_unity_ksprefabcache_getprefab_system_uint32_system_string" id="ks_reactor_client_unity_ksprefabcache_getprefab_system_uint32_system_string"></a>

Loads an entity prefab from resources, an asset bundle, or the cache.

```csharp
public GameObject GetPrefab(uint assetId, string entityType)
```

#### Parameters

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

Asset ID

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

Entity type

#### Returns

GameObject

Prefab assigned to the asset ID and/or entity type. Null if no prefab was found.

### IsPseudoPrefab(GameObject) <a href="#ks_reactor_client_unity_ksprefabcache_ispseudoprefab_unityengine_gameobject" id="ks_reactor_client_unity_ksprefabcache_ispseudoprefab_unityengine_gameobject"></a>

Checks if a game object is a pseudo prefab. Pseudo-prefabs are disabled instances of prefabs which have had instances of child objects containing ksEntityComponents removed. Reactor uses these objects as a workaround to a Unity prefab limitation that does not allow you to delete prefab child objects or create prefabs at runtime.

```csharp
public bool IsPseudoPrefab(GameObject gameObject)
```

#### Parameters

`gameObject` GameObject

Game object to check.

#### Returns

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

True if the game object is a pseudo prefab.
