Show / Hide Table of Contents

Class PrefabManager.Cache

Global cache of Unity Objects by asset name.
Built on first access of every type and is cleared on scene change.
Inheritance
object
PrefabManager.Cache
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public static class PrefabManager.Cache

Methods

Name Description
Clear() Clears the entire cache, resulting in a rebuilt on the next access.
This can be useful if an asset is loaded late after a scene change and might be missing in the cache. Rebuilding can be an expensive operation, so use with caution.
Clear<T>() Clears the cache for a specific type, resulting in a rebuilt on the next access.
This can be useful if an asset is loaded late after a scene change and might be missing in the cache. Rebuilding can be an expensive operation, so use with caution.
GetPrefab(Type, string) Get an instance of an Unity Object from the current scene with the given name.
GetPrefab<T>(string) Get an instance of an Unity Object from the current scene by name.
GetPrefabs(Type) Get all instances of an Unity Object from the current scene by type.
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾