API

Assembly: Spark.CharacterCustomization Interface: ICharacterCustomizationPlugin Implementation: CharacterCustomizationPlugin

Interface

public interface ICharacterCustomizationPlugin
{
    // Database queries
    List<CustomizationCategoryEntry> GetAllCategories();
    CustomizationCategoryEntry GetCategory(string categoryId);
    List<CustomizationElementEntry> GetElementsInCategory(string categoryId);
    CustomizationElementEntry GetElement(string elementId);
    List<CustomizationColorEntry> GetColorsInCategory(string categoryId);
    CustomizationColorEntry GetColor(string colorId);
    List<CustomizationPresetEntry> GetAllPresets();
    CustomizationPresetEntry GetPreset(string presetId);

    // Customization operations
    bool ApplyElement(string entityId, string elementId);
    bool DeactivateElement(string entityId, string elementId);
    bool ApplyColor(string entityId, string colorId, Color? color = null);

    // State
    CustomizationState GetCustomizationState(string entityId);
}

Database Entries

CustomizationCategoryEntry

Extends SparkDatabaseEntry. Groups customization options (Hair, Face, Skin, etc.).

Field
Type
Description

sortOrder

int

Display order in UI

CustomizationElementEntry

Extends SparkDatabaseEntry. A single customization option within a category.

Field
Type
Description

category

CustomizationCategoryEntry

Parent category

isRequired

bool

Must be selected

sortOrder

int

Display order

CustomizationColorEntry

Extends SparkDatabaseEntry. A material-based color option.

Field
Type
Description

materialPropertyName

string

Shader property (e.g., "_BaseColor")

colorOptions

List<CustomizationColorOption>

Available colors

sortOrder

int

Display order

CustomizationPresetEntry

Extends SparkDatabaseEntry. A complete preset configuration.

Field
Type
Description

presetElements

List<PresetCategoryData>

Element selections

presetColors

List<PresetCategoryColorData>

Color selections

State Classes

CustomizationState

Field
Type
Description

elements

List<ElementState>

Active element selections

colors

List<ColorState>

Active color selections

ElementState

Field
Type
Description

elementId

string

Selected element

activeOptionIndex

int

Active option within element

ColorState

Field
Type
Description

colorId

string

Color entry ID

currentColor

Color

Selected color value

Events

Event
Fields
Description

CustomizationElementAppliedEvent

EntityId, ElementId, CategoryId

Element activated

CustomizationElementRemovedEvent

EntityId, ElementId, CategoryId

Element deactivated

CustomizationColorChangedEvent

EntityId, CategoryId, NewColor

Color changed

Commands

Command
Fields
Description

ApplyCustomizationElementCommand

EntityId, ElementId, Color?

Apply element or color

Components

CharacterCustomizationEntity

MonoBehaviour managing customization on a character.

Initialization Methods:

Customization Methods:

State Methods:

Events: OnElementActivated, OnElementDeactivated, OnColorActivated, OnColorChanged

Save Data

CharacterCustomizationSaveData

Extends SaveDataEntry.

Field
Type
Description

playerElements

List<ElementState>

Saved element selections

playerColors

List<ColorState>

Saved color selections

Methods:

Usage

Last updated

Was this helpful?