Show / Hide Table of Contents

Class AssetManager

Manager to handle interactions with the vanilla asset system, called SoftReferenceableAssets. See the Vanilla FAQ for more information.
Inheritance
object
AssetManager
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 class AssetManager

Properties

Name Description
Instance The singleton instance of this manager.

Methods

Name Description
AddAsset(Object) Registers a new asset and generates a unique AssetID.
Assets can be added at any time and will be registered as soon as the vanilla loader is ready.
AddAsset(Object, Object) Registers a new asset with the same asset dependencies as the original asset and generates a unique AssetID.
Assets can be added at any time and will be registered as soon as the vanilla loader is ready.
ClonePrefab(GameObject, string, Transform) Clones a prefab and registers it in the SoftReference system with the same dependencies as the original asset
GenerateAssetID(Object) Generates a unique AssetID, based on the asset name
GetAssetID(Type, string) Finds the AssetID by an asset name at runtime.
The closed matching base type must be used. E.g. for prefabs use GameObject, for Textures use Texture2D etc.
If no asset is found, an invalid AssetID is returned.
GetAssetID<T>(string) Finds the AssetID by an asset name at runtime.
The closed matching base type must be used. E.g. for prefabs use GameObject, for Textures use Texture2D etc.
If no asset is found, an invalid AssetID is returned.
GetSoftReference(Type, string) Finds the AssetID by an asset name at runtime and returns a SoftReference to the asset.
GetSoftReference<T>(string) Finds the AssetID by an asset name at runtime and returns a SoftReference to the asset.
IsReady() Checks if the vanilla loader is ready. If false, SoftReferenceableAssets.Runtime.Loader must not be accessed and no assets may be loaded. If the vanilla loader is initialized too early, mods can become incompatible.

Extension Methods

PrefabExtension.FixReferences(object)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾