Skip to main content

CosmeticPresetDestroyer

A class in Root.Township, Alta.Customization.

Bin for preset trophies in the customization room. Destroys trophies dropped into it and raises events while any are nearby.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private CosmeticPresetTrophyTrigger destroyTriggerTrigger that destroys trophies.
private UnityEvent HasTrophiesEvent raised when the first trophy comes near.
private UnityEvent NoTrophiesEvent raised when the last nearby trophy leaves.
private CosmeticPresetTrophyTrigger proximityTriggerLarger trigger that tracks trophies near the bin.
private HashSet<CosmeticPresetTrophy> trackedTrophiesTrophies currently inside the proximity trigger.
private TransformHandler trophyGotDestroyedEvent given the trophy's transform just before it is destroyed, for effects.

Methods​

5 private and internal methods
MemberWhat it is
private void Awake()Hooks up the proximity and destroy triggers.
private void CheckDestroy(CosmeticPresetTrophy trophy)Destroys a trophy that enters the destroy trigger while nobody is holding it.
private void DestroyTrophy(CosmeticPresetTrophy trophy)Destroys a trophy released in the destroy trigger, if it is also inside the proximity trigger.
private void TrophyEntered(CosmeticPresetTrophy trophy)Adds a trophy to the tracked set and fires HasTrophies when it is the first.
private void TrophyExited(CosmeticPresetTrophy trophy)Removes a trophy from the tracked set and fires NoTrophies when none are left.