Skip to main content

PickupBreakOnImpact

A class in Root.Township, Alta.Impact.

A BreakOnImpact for pickups that flags the first 0.1 seconds after a grab. In this build nothing reads the flag, so it behaves like plain BreakOnImpact.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private bool isRecentGrabTrue for 0.1 seconds after a grab. Not read anywhere in this build.
private Pickup pickupThe pickup on the same object.
private Coroutine timedDisableCoroutineThe running TimedBreakDisable coroutine, if any.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Hooks DisableBreak into the pickup's InteractionStarted.
private void DisableBreak(Interactable arg1, Interactor arg2)On grab, restarts the short TimedBreakDisable coroutine.
private IEnumerator TimedBreakDisable() (iterator)Sets isRecentGrab for 0.1 seconds, then clears it.