EditableSlot
A class in Root.Township, Alta.Customization.
A spot on the customization mannequin for one group of slots. Grab it to pull the item off as a pickup, or drop a fitting pickup in its trigger to put it on. Client side.
- Listed in Customization and screenshots
- Inherits or implements
MonoBehaviour - Derived types
EditableCosmeticSlot,EditableEquipmentSlot
Constructors
| Member | What it is |
|---|---|
EditableSlot() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private CustomizationWrapper activeWrapper | Customization wrapper being edited, or null when inactive. |
private TriggerShape addTrigger | Trigger where pickups are dropped to add them. |
private HandIndex editableWith | Which hand may edit this slot. Default both. |
private Dictionary<CustomizationPickup, int> hovering | Pickups in the trigger and how many of their colliders are inside. |
private static readonly Logger logger | NLog logger for this class. |
private Interactable remover | Interactable grabbed to take the item off. |
private PlayerCustomizationSlotSet slots | Slot set this editable slot covers. |
Methods
| Member | What it is |
|---|---|
void Activate(CustomizationWrapper wrapper) | Starts editing a customization wrapper: hooks the trigger and remover and enables the object. |
void Deactivate() | Stops editing: unhooks events, clears hovering pickups and disables the object. |
protected uint Remove(Interactor interactor, out CustomizationArguments[] arguments) | Removes the first item found in this slot's enabled slots, pushing history, and returns its hash (0 if none). |
10 private and internal methods
| Member | What it is |
|---|---|
private bool Add(ControllerExtension interactor, ICustomizationDefinition item, CustomizationArguments[] arguments) | Adds an item to the wrapper if the hand may edit and the item fits these slots. |
private void AttemptPlace(Interactable interactable, Interactor interactor) | When a hovering pickup is let go, tries to add a copy of its item and tells the pickup whether it worked. |
private bool CanEdit(HandIndex hand) | Whether a hand may edit: needs an active wrapper and a matching hand if editableWith isn't both. |
private void Filter(Interactor interactor, Interactable interactable, ref bool result) | Interaction filter on the remover; blocks the wrong hand and blocks grabbing when all its slots are disabled. |
private bool Hover(ControllerExtension interactor, ICustomizationDefinition item) | Whether a held item is one this slot would accept from that hand. |
private async void InteractedWith(Interactable interactable, Interactor interactor) | When the remover is grabbed, removes the slot's item and swaps the hand to a new pickup of it. |
private bool IsApplicable(ICustomizationDefinition item) | Whether any part of the item uses one of this slot's slots. |
private void OnValidate() | Editor: fills addTrigger from the same object if empty. |
private void TriggerEntered(Collider collider) | Starts tracking a held customization pickup that enters and fits, so dropping it places it. |
private void TriggerExited(Collider collider) | Stops tracking a pickup once all its colliders have left. |