Table of Contents

Class AvatarEquippableRegistry

Namespace
S1API.Items
Assembly
S1API.dll

Manages registration and loading of AvatarEquippable prefabs from AssetBundles. Allows modders to load AvatarEquippable prefabs and register them so they can be used with equippable items.

public static class AvatarEquippableRegistry
Inheritance
AvatarEquippableRegistry
Inherited Members

Remarks

This class now uses RuntimeResourceRegistry internally for asset registration.

Methods

GetRegisteredPrefab(string)

Gets a registered AvatarEquippable prefab.

public static GameObject GetRegisteredPrefab(string assetPath)

Parameters

assetPath string

The Resources path.

Returns

GameObject

The registered prefab, or null if not found.

IsRegistered(string)

Checks if an AvatarEquippable is registered at the given path.

public static bool IsRegistered(string assetPath)

Parameters

assetPath string

The Resources path to check.

Returns

bool

True if registered, false otherwise.

LoadAndRegisterFromBundle(WrappedAssetBundle, string, string)

Loads an AvatarEquippable prefab from an AssetBundle and registers it.

public static bool LoadAndRegisterFromBundle(WrappedAssetBundle bundle, string prefabName, string assetPath)

Parameters

bundle WrappedAssetBundle

The AssetBundle containing the prefab.

prefabName string

The name of the prefab asset in the bundle.

assetPath string

The Resources path to register (e.g., "Equippables/MyItem").

Returns

bool

True if loading and registration were successful.

LoadAndRegisterFromEmbeddedBundle(string, string, string, Assembly)

Loads an AvatarEquippable prefab from an embedded AssetBundle and registers it.

public static bool LoadAndRegisterFromEmbeddedBundle(string bundleName, string prefabName, string assetPath, Assembly assemblyOverride = null)

Parameters

bundleName string

The name of the embedded AssetBundle resource.

prefabName string

The name of the prefab asset in the bundle.

assetPath string

The Resources path to register (e.g., "Equippables/MyItem").

assemblyOverride Assembly

Optional assembly to load the bundle from. If null, uses executing assembly.

Returns

bool

True if loading and registration were successful.

RegisterAvatarEquippable(string, GameObject)

Registers an AvatarEquippable prefab with a Resources path. After registration, the prefab can be loaded via Resources.Load using the provided assetPath.

public static bool RegisterAvatarEquippable(string assetPath, GameObject prefab)

Parameters

assetPath string

The Resources path to register (e.g., "Equippables/MyItem").

prefab GameObject

The AvatarEquippable prefab GameObject to register.

Returns

bool

True if registration was successful.

Remarks

The prefab must have an AvatarEquippable component attached. Ensure the assetPath matches what you'll use in WithAvatarEquippable().