A class in Root.Township, Alta.Impact.
Fires an inspector event when its ImpactTool blocks a hit with enough effectiveness, optionally only once.
Constructors
| Member | What it is |
|---|
BlockedTrigger() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private bool disableAfterBlock | When set, IsActive turns off after one block. |
private float minimumEffectiveness | Lowest hit effectiveness that counts as a block. |
private FloatEvent onBlocked | Event invoked with the hit's effectiveness. |
Properties
| Member | What it is |
|---|
bool IsActive { get; set; } | Whether blocks currently fire the event. Starts false, so something must turn it on. |
Methods
2 private and internal methods
| Member | What it is |
|---|
private void Awake() | Hooks the impact tool's OnBlocked event. |
private void Blocked(ImpactHitWithTool hit, ImpactTool tool) | If active and the hit's effectiveness is high enough, invokes onBlocked and maybe deactivates. |