Skip to main content

PlayerEquipmentDefinition

A class in Root.Township, Alta.Customization.

Definition asset for a wearable piece of equipment: its pickup, visual, category and armour slot. Seems left over from the removed equipment system; Hash is always 0 and UISelectionBoardScale throws.

Constructors​

MemberWhat it is
PlayerEquipmentDefinition()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

6 private and internal fields
MemberWhat it is
private ArmorDefinition armorDefinitionArmor stats this equipment gives.
private EquipmentSlot armorSlotBody slot the armor goes in.
private CustomizationCategory categoryCustomization category it belongs to.
private CustomizationPickup pickupPickup prefab spawned for this equipment.
private CosmeticPickupType pickupTypeKind of cosmetic pickup.
private CustomizationVisual visualPrefabVisual put on the player when worn; also supplies the default arguments.

Properties​

MemberWhat it is
ArmorDefinition ArmorDefinition { get; }Armour stats for this equipment.
EquipmentSlot ArmorSlot { get; }Which equipment slot it goes in.
ICustomizationCategory Category { get; set; }Customization category. Can only be set in the editor.
uint Hash { get; }Always 0, hiding the asset hash.
string Name { get; }The asset's name.
CosmeticPickupType PickupType { get; }The cosmetic pickup type.
float UISelectionBoardScale { get; }Not implemented. Always throws NotImplementedException.

Methods​

MemberWhat it is
CustomizationArguments[] CreateDefaultArguments()Default customization arguments from the visual prefab.
ICustomizationVisual GetVisual()Initializes and returns the visual prefab for this definition. Not a new copy.
void Release()Does nothing.
CustomizationPickup SpawnPickup(CustomizationArguments[] arguments, Transform parent)Spawns the customization pickup under a parent with the given arguments.
override string ToString()Type, category and name as text.