ImmediateDecay
A class in Root.Township, the global namespace.
Destroys a pickup soon after it is let go, with a fade effect, unless it is picked up again or docked. Nothing in the code calls InitializeAsServer or sets Pickup, so it probably does nothing as is.
- Listed in Global namespace: I to L
- Inherits or implements
NetworkEntityBehaviour
Constructors
| Member | What it is |
|---|---|
ImmediateDecay() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private Coroutine decay | The running decay coroutine, if any. |
private float decayDuration | Seconds the decay effect plays before the entity is destroyed. |
private EffectReleaseOnFade decayEffect | The decay effect playing now. |
private PooledObjectDefinition decayEffectDefinition | Pooled effect to play while decaying. |
private float delayToStartDecaying | Seconds after release before the decay effect starts. |
Properties
| Member | What it is |
|---|---|
Pickup Pickup { get; private set; } | The pickup whose release starts the decay. |
Methods
6 private and internal methods
| Member | What it is |
|---|---|
private IEnumerator Decay() (iterator) | Coroutine: if not docked, waits, plays the decay effect, waits again, then destroys the entity on the server. |
private void InitializeAsServer() | Hooks the decay start and stop to the pickup's release, grab and dock events. |
private void OnDestroy() | Releases the decay effect if one is playing. |
private void StartDecay(Interactable interactable, Interactor interactor) | Starts the decay coroutine when the pickup is released. |
private void StopDecay(Interactable interactable, Interactor interactor) | Stops the decay and its effect when the pickup is grabbed. |
private void StopDecayDock(Interactor interactor, Pickup pickup, PickupDock dock) | Stops the decay and its effect when the pickup is docked. |