A class in Root.Township, Alta.Customization.
A purchasable cosmetic asset: its category, pickup and visual prefab.
Constructors
| Member | What it is |
|---|
PlayerCosmeticDefinition() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private CustomizationCategory category | Backing field for Category. Its setter only works in the editor, and as written it throws even after setting a valid category. |
private CustomizationPickup pickup | Pickup prefab used by SpawnPickup. |
private CosmeticPickupType pickupType | Backing field for PickupType. |
private float uiSelectionBoardScale | Backing field for UISelectionBoardScale. Defaults to 1. |
private CustomizationVisual visualPrefab | Visual prefab returned by GetVisual and used for default arguments. |
Properties
| Member | What it is |
|---|
ICustomizationCategory Category { get; set; } | The cosmetic's category. The setter only works in the editor, and as written it throws even after a valid set. |
string Name { get; } | The display name. |
CosmeticPickupType PickupType { get; } | What kind of pickup this cosmetic uses. |
float UISelectionBoardScale { get; } | Scale of the item on the customization selection board. |
Methods
| Member | What it is |
|---|
CustomizationArguments[] CreateDefaultArguments() | Default customization arguments for each part of the visual. |
ICustomizationVisual GetVisual() | Points the visual prefab at this definition, initializes it and returns it. |
CustomizationPickup SpawnPickup(CustomizationArguments[] arguments, Transform parent) | Spawns the cosmetic's pickup with the given arguments under a parent. |
override string ToString() | Type, category and name, for logs. |
Used in
Members of other types that take, return or hold a PlayerCosmeticDefinition: