InteractionCollisionController
A class in Root.Township, Alta.Character.
Makes a collider group ignore a pickup's colliders while an Interactor holds it.
Constructors
| Member | What it is |
|---|
InteractionCollisionController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private ColliderGroup colliders | The collider group that ignores held pickups. |
private Interactor interactor | The interactor (hand) to watch. |
private List<Collider> pickupColliders | Colliders of the currently held pickup. |
Methods
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Subscribes to the interactor's start and end events. |
private void InteractionEnded(Interactor interactor, Interactable interactable) | Turns collision back on with the cached pickup colliders and clears the cache. |
private void InteractionStarted(Interactor interactor, Interactable interactable) | If the interactable is a pickup, caches its colliders and makes the group ignore them. |