Exemplo n.º 1
0
 void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.collider.tag == "floor")
     {
         FindObjectOfType <audioManager> ().collision();
         StartCoroutine(gm.gameOver());
     }
     if (coll.collider.tag == "bounds")
     {
         FindObjectOfType <audioManager> ().collision();
         FindObjectOfType <audioManager> ().play("deathTouch");
         cont.disabledState = 3;
     }
     if (coll.collider.name == "brightfeathers" && coll.relativeVelocity.magnitude > 10 && cont.disabledState == 0)
     {
         FindObjectOfType <audioManager> ().collision();
         StartCoroutine(cont.stunned(2));
     }
     if (coll.collider.tag == "croc" && coll.relativeVelocity.magnitude > 10 && cont.disabledState == 0)
     {
         FindObjectOfType <audioManager> ().collision();
         StartCoroutine(cont.stunned(1));
     }
     if (coll.collider.tag == "vine")
     {
         FindObjectOfType <audioManager> ().play("deathTouch");
         cont.disabledState = 3;
     }
 }
Exemplo n.º 2
0
 public void takeDamage()
 {
     if (canBeDamaged)
     {
         confortLevel--;
         if (confortLevel <= 0)
         {
             master.gameOver();
         }
         canBeDamaged = false;
         animator.SetTrigger("doFade");
         StartCoroutine(waitThree());
     }
 }