Table of Contents

Class ClothingItemDefinitionBuilder

Namespace
S1API.Items
Assembly
S1API.dll

Builder for composing clothing item definitions at runtime. Use fluent methods to configure clothing properties before calling Build().

[Obsolete("Use S1API.Items.Clothing.ClothingItemDefinitionBuilder instead")]
public sealed class ClothingItemDefinitionBuilder
Inheritance
ClothingItemDefinitionBuilder
Inherited Members
Extension Methods

Methods

Build()

Builds the clothing item definition, registers it with the game's registry, and returns a wrapper.

public ClothingItemDefinition Build()

Returns

ClothingItemDefinition

A wrapper around the created clothing item definition.

WithApplicationType(ClothingApplicationType)

Sets how this clothing item is applied to the avatar.

public ClothingItemDefinitionBuilder WithApplicationType(ClothingApplicationType applicationType)

Parameters

applicationType ClothingApplicationType

The application type.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithBasicInfo(string, string, string)

Sets the basic information for the clothing item.

public ClothingItemDefinitionBuilder WithBasicInfo(string id, string name, string description)

Parameters

id string

Unique identifier for the item (e.g., "my_custom_hat").

name string

Display name shown in UI.

description string

Item description shown in tooltips.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithBlockedSlots(params ClothingSlot[])

Sets the list of clothing slots this item blocks when equipped.

public ClothingItemDefinitionBuilder WithBlockedSlots(params ClothingSlot[] slots)

Parameters

slots ClothingSlot[]

Array of slots to block.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithClothingAsset(string)

Sets the asset path to the clothing prefab or layer.

public ClothingItemDefinitionBuilder WithClothingAsset(string assetPath)

Parameters

assetPath string

Resources path to the clothing asset.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithColorable(bool)

Sets whether this clothing item can be colored.

public ClothingItemDefinitionBuilder WithColorable(bool colorable)

Parameters

colorable bool

True if colorable, false otherwise.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithDefaultColor(ClothingColor)

Sets the default color for this clothing item.

public ClothingItemDefinitionBuilder WithDefaultColor(ClothingColor color)

Parameters

color ClothingColor

The default color.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithIcon(Sprite)

Sets the icon sprite displayed for this item in UI.

public ClothingItemDefinitionBuilder WithIcon(Sprite icon)

Parameters

icon Sprite

The sprite to use as the item icon.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithPricing(float, float)

Configures the economic properties of the item.

public ClothingItemDefinitionBuilder WithPricing(float basePurchasePrice, float resellMultiplier = 0.5)

Parameters

basePurchasePrice float

Base price when buying from shops.

resellMultiplier float

Fraction of purchase price recovered when selling (0.0 to 1.0).

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.

WithSlot(ClothingSlot)

Sets the clothing slot this item occupies.

public ClothingItemDefinitionBuilder WithSlot(ClothingSlot slot)

Parameters

slot ClothingSlot

The clothing slot.

Returns

ClothingItemDefinitionBuilder

The builder instance for fluent chaining.