示例#1
0
 private void OnTriggerExit(Collider other)
 {
     if (!ReferenceEquals(objectTryingToIgnite, null))
     {
         objectTryingToIgnite = null;
     }
 }
示例#2
0
    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;
            }
        }
    }