Example #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Enemy")
     {
         if (!Targets.Contains(other.gameObject))
         {
             Targets.Add(other.gameObject);
         }
     }
     else if (other.tag == "Torch")
     {
         if (sword)
         {
             GameObject l = other.transform.GetChild(0).gameObject;
             if (l.active == false)
             {
                 l.SetActive(true);
             }
             other.transform.GetChild(0).GetComponent <Animator>().SetTrigger("Allumage");
         }
     }
     else if (other.tag == "Wall")
     {
         if (sword)
         {
             player.BoostLight();
             durability--;
             if (durability <= 0)
             {
                 sword  = false;
                 weapon = false;
             }
             player.Hud.SetSword();
         }
     }
 }