Skip to main content

CustomizationVisual

A class in Root.Township, Alta.Customization.

Prefab component for one cosmetic's look: its visual parts plus the slots it takes as primary and the slots it disables.

Constructors​

MemberWhat it is
CustomizationVisual()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private PlayerCustomizationSlotSet additionalPrimaryExtra slots treated as primary on top of the primary parts' own.
private PlayerCustomizationSlotSet disableSlotsBacking set for DisableSlots.
private static Logger loggerNLog logger for validation errors.
private CustomizationVisualPart[] partsBacking field for Parts.

Properties​

MemberWhat it is
ICustomizationDefinition Definition { get; set; }The cosmetic definition this visual belongs to.
IEnumerable<int> DisableSlots { get; }Slots disabled while this visual is worn.
ICustomizationPart[] Parts { get; }The visual's parts.
IEnumerable<int> PrimarySlots { get; }Slots of the primary parts plus additionalPrimary.

Methods​

MemberWhat it is
CustomizationArguments[] CreateDefaultArguments()Fresh copies of every part's default arguments, one per part.
void Initialize()Gives each part its index and a link back to this visual.
2 private and internal methods
MemberWhat it is
private bool HasCircularReference()Editor check: whether any mesh part's copy-colour-from chain loops back to itself, which crashes painting.
private void OnValidate()Logs an error if there are no primary slots or there is a circular colour reference.

Used in​

Members of other types that take, return or hold a CustomizationVisual: