Skip to main content

ImpactHitThresholdTrigger

A class in Root.Township, Alta.Impact.

Fires inspector events when an ImpactDetector takes a hit above set effectiveness and damage, with an extra event naming the player who hit it.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private bool checksForPlayersWhether the player event has listeners, so the hitting player is looked up.
private ImpactDetector detectorThe impact detector listened to.
private float minimumDamageLowest health damage that counts.
private float minimumEfficiencyLowest hit effectiveness that counts.
private PositionEvent OnEffectivelyHitEvent invoked with the hit point for each hit that passes.
private PlayerEvent onEffectivelyHitByPlayerEvent invoked with the player who made a passing hit, from the tool or the wielder.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Hooks the detector's Hit event and notes whether the player event has listeners.
private void OnHit(ImpactHit impact)Checks the thresholds, then invokes the player event (if used) and the position event.