private void OnTriggerExit(Collider other) { if (!ReferenceEquals(objectTryingToIgnite, null)) { objectTryingToIgnite = null; } }
private void OnTriggerStay(Collider other) { Igniteable igniteableObject = other.GetComponent <Igniteable>(); if (igniteableObject && lit && (ReferenceEquals(igniteableObject, null) || !ReferenceEquals(igniteableObject, objectTryingToIgnite))) { RaycastHit hit; if (Physics.Raycast(raycastOrigin.transform.position, other.transform.position - raycastOrigin.transform.position, out hit)) { igniteableObject.Ignite(hit.point); objectTryingToIgnite = igniteableObject; } } }