Skip to main content

CustomizationPickup

A class in Root.Township, Alta.Customization.

Base for the grabbable items in the character customization area (cosmetics, body types, eyes, equipment). Client side; spawned from a template with Spawn.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private HoverPickup hoverPickupBacking field for HoverPickup, snapped back after a placement result.
private Pickup pickupBacking field for Pickup.

Properties​

MemberWhat it is
CustomizationArguments[] Arguments { get; private set; }The customization arguments (such as colours) this pickup applies, set by Spawn.
virtual ICustomizationDefinition Definition { get; protected set; }The cosmetic or customization definition this pickup represents, set by Spawn.
HoverPickup HoverPickup { get; }The HoverPickup on the same object.
Pickup Pickup { get; }The Pickup on the same object.

Methods​

MemberWhat it is
void DestroyOnRelease()Makes the pickup destroy itself shortly after it is let go, unless it is grabbed again.
virtual void HandlePlacementResult(bool wasAdded)Plays the added or disappear effect (not on headless) and snaps the hover pickup back.
virtual CustomizationPickup Spawn(ICustomizationDefinition definition, CustomizationArguments[] arguments, Transform parent)Instantiates a copy of this pickup under a parent and gives it a definition and arguments.
protected virtual void DestroyPickup()Destroys the pickup's game object. Override to pool or animate instead.
2 private and internal methods
MemberWhat it is
private void DelayDestroy()Destroys the pickup if nobody picked it up again since release.
private void DestroyOnInteractEnd(Interactable arg1, Interactor arg2)On release, waits a frame then calls DelayDestroy.

Used in​

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