Exemplo n.º 1
0
 private void OnTriggerStay(Collider other)
 {
     if (isAlight)
     {
         RaycastHit hit;
         Physics.Raycast(transform.position, other.transform.position - transform.position, out hit);
         if (hit.collider != other)
         {
             return;
         }
         if (other.GetComponentInParent <Renderer>())
         {
             if (fireManager.GetIfFlammable(other.GetComponentInParent <Renderer>().sharedMaterial))
             {
                 if (!other.GetComponentInChildren <FireSystem>())
                 {
                     fireManager.AddFireSystem(other.gameObject);
                 }
                 else if (!other.GetComponent <MeshCollider>())
                 {
                     BurnOther(other.GetComponentInChildren <FireSystem>());
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 protected virtual void OnTriggerStay(Collider other)
 {
     if (isAlight)
     {
         if (fireManager.GetIfFlammable(other.GetComponentInParent <Renderer>().sharedMaterial))
         {
             if (!other.GetComponentInChildren <FireWithTemperatureAndFuel>())
             {
                 fireManager.AddFireSystem(other.gameObject);
             }
             else if (!other.GetComponent <MeshCollider>())
             {
                 SpreadTemperature(other.GetComponentInChildren <FireWithTemperatureAndFuel>());
             }
         }
     }
 }