Skip to main content

CookingPotVolume

A class in Root.Township, Alta.Cooking.

Trigger volume on a cooking pot that tracks which rigidbodies are inside it. CookingPot listens to its events.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private HashSet<Collider> containedCollidersColliders currently inside the volume.

Properties​

MemberWhat it is
HashSet<GameObject> ContainedCookables { get; }GameObjects of the rigidbodies currently inside the volume.

Events​

MemberWhat it is
event Action<GameObject> IngredientAddedRaised with a rigidbody's GameObject when it first enters the volume.
event Action<GameObject> IngredientRemovedRaised with a rigidbody's GameObject when it leaves the volume.

Methods​

2 private and internal methods
MemberWhat it is
private void OnTriggerEnter(Collider other)Unity callback. Adds the collider's rigidbody and raises IngredientAdded.
private void OnTriggerExit(Collider other)Unity callback. Removes the collider's rigidbody and raises IngredientRemoved.

Used in​

Members of other types that take, return or hold a CookingPotVolume: