TriggerImpactTool
A class in Root.Township, Alta.Impact.
An ImpactTool that hits through a trigger collider instead of physics collisions, working out a contact point itself. Used for swings and other hits that should not push things.
- Listed in Items, inventory and logic
- Inherits or implements
ImpactTool - Nested types
DelayedHit - Documented in Impacts and hit detection
Constructors
| Member | What it is |
|---|---|
TriggerImpactTool() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private LayerMask forcedContact | Layers that always get a blunt hit even without a pickup or detector, like terrain. |
private List<TriggerImpactTool.DelayedHit> frameHits | Hits queued this frame, applied one frame later by RunDelayedHits. |
private HashSet<HealthObject> hitHealthObjects | Health objects already hit, when isHittingOncePerHealthObject is on. |
private HashSet<Rigidbody> hitRigidBodies | Rigidbodies already hit since the tool was last activated. |
private List<ImpactDetector> ignore | Detectors this tool never hits. |
private bool isActive | Backing field for IsActive. |
private bool isHittingOncePerHealthObject | When on, the tool hits each health object only once, even through several colliders. |
private bool isLockedForFrame | Set after a fully blocking hit; further trigger entries are ignored until the queued hits run. |
private Vector3 physicsPosition | The tool's position from the last fixed update. |
private Collider thisCollider | The tool's trigger collider. |
private IUnityUpdateMethod update | The registered fixed update for UpdatePosition. |
Properties
| Member | What it is |
|---|---|
bool IsActive { get; set; } | Turns the trigger collider and position tracking on or off; turning it on or off forgets what was already hit. |
Methods
4 private and internal methods
Used in
Members of other types that take, return or hold a TriggerImpactTool: