Class ClothingItemDefinitionBuilder
Builder for composing clothing item definitions at runtime. Use fluent methods to configure clothing properties before calling Build().
public class ClothingItemDefinitionBuilder : StorableItemDefinitionBuilderBase<ClothingItemDefinitionBuilder>
- Inheritance
-
ClothingItemDefinitionBuilder
- Inherited Members
- Extension Methods
Methods
Build()
Builds the 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.
CopyPropertiesFrom(StorableItemDefinition)
Copies all properties from a source definition to the current definition.
protected override void CopyPropertiesFrom(StorableItemDefinition source)
Parameters
sourceStorableItemDefinitionThe source definition to copy from.
CreateWrapper(StorableItemDefinition)
Creates a wrapper around the given item definition. Subclasses can override this to return a more specific wrapper type.
protected override StorableItemDefinition CreateWrapper(StorableItemDefinition definition)
Parameters
definitionStorableItemDefinitionThe item definition to wrap.
Returns
- StorableItemDefinition
A wrapper around the given item definition.
WithApplicationType(ClothingApplicationType)
Sets how this clothing item is applied to the avatar.
public ClothingItemDefinitionBuilder WithApplicationType(ClothingApplicationType applicationType)
Parameters
applicationTypeClothingApplicationTypeThe application type.
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
slotsClothingSlot[]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
assetPathstringResources 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
colorableboolTrue 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
colorClothingColorThe default color.
Returns
- ClothingItemDefinitionBuilder
The builder instance for fluent chaining.
WithSlot(ClothingSlot)
Sets the clothing slot this item occupies.
public ClothingItemDefinitionBuilder WithSlot(ClothingSlot slot)
Parameters
slotClothingSlotThe clothing slot.
Returns
- ClothingItemDefinitionBuilder
The builder instance for fluent chaining.