Skip to main content

ImpactDetectionLogic

A class in Root.Township, the global namespace.

Timer logic that switches on for a while each time an impact detector is hit, raising a bool event when it turns on and off.

Constructors​

MemberWhat it is
ImpactDetectionLogic()Creates an ImpactDetectionLogic with default values.

Fields​

2 private and internal fields
MemberWhat it is
private ImpactDetector impactDetectorThe detector to watch.
private BoolUnityEvent onHitChangedEvent raised with true when hit and false when the timer runs out.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Hooks the detector's hits and forwards the timer toggle to onHitChanged.
private void WasHit(ImpactHit impact)Starts the active timer when the detector is hit.