Table of Contents

Class AvatarLayerFactory

Namespace
S1API.Rendering
Assembly
S1API.dll

Factory for creating runtime avatar layer variants by cloning an existing layer and replacing its texture.

public static class AvatarLayerFactory
Inheritance
AvatarLayerFactory
Inherited Members

Methods

CloneAvatarLayerWithTexture(string, string, Texture2D, string?)

Clones an avatar layer asset and replaces its primary texture.

public static Object? CloneAvatarLayerWithTexture(string sourceResourcePath, string newName, Texture2D replacementTexture, string? targetResourcePath = null)

Parameters

sourceResourcePath string

The Resources path to the source avatar layer.

newName string

The display name to assign to the cloned layer.

replacementTexture Texture2D

The replacement texture to assign to the cloned layer.

targetResourcePath string

Optional target resource path for the cloned layer.

Returns

Object

The cloned avatar layer object, or null if cloning failed.

CreateAndRegisterAvatarLayer(string, string, string, Texture2D)

Creates and registers a cloned avatar layer with a replacement texture.

public static bool CreateAndRegisterAvatarLayer(string sourceResourcePath, string targetResourcePath, string newName, Texture2D replacementTexture)

Parameters

sourceResourcePath string

The Resources path to the source avatar layer.

targetResourcePath string

The Resources path where the cloned layer will be registered.

newName string

The display name to assign to the cloned layer.

replacementTexture Texture2D

The replacement texture to assign to the cloned layer.

Returns

bool

true if the avatar layer was created and registered successfully; otherwise false.

RegisterAvatarLayer(string, Object)

Registers a cloned avatar layer so it can be resolved through UnityEngine.Resources.Load(System.String).

public static bool RegisterAvatarLayer(string resourcePath, Object avatarLayer)

Parameters

resourcePath string

The Resources path to register the avatar layer at.

avatarLayer Object

The cloned avatar layer object to register.

Returns

bool

true if the avatar layer was registered successfully; otherwise false.