Skip to main content

ImpactHitTrigger

A class in Root.Township, Alta.Impact.

Fires an AltaEvent when an ImpactDetector takes a hit with enough damage and of an allowed impact type.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private ImpactDetector detectorThe impact detector listened to.
private ImpactTypeFilter impactTypeFilterWhich impact types count.
private float minDamageToDetectLowest health damage that counts.
private AltaEvent triggerEvent invoked on a valid hit.

Methods​

3 private and internal methods
MemberWhat it is
private void CheckForValidHit(ImpactHit impact)Invokes trigger if the hit's damage and impact type pass.
private void OnDisable()Unhooks the detector's Hit event.
private void OnEnable()Hooks the detector's Hit event.