Ejemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         plrhealth.DamagePlayer(damage);
         Instantiate(particleSys, this.transform.position, Quaternion.identity);
         Destroy(this.gameObject);
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         playerHealth plr  = collision.gameObject.GetComponent <playerHealth>();
         Player       move = collision.gameObject.GetComponent <Player>();
         if (plr.currentPlayerHealth >= 0 && gm.ArmourAmount >= 0)
         {
             move.Jump(jumpHeight);
             gm.ArmourAmount--;
         }
         if (plr.currentPlayerHealth <= 1 && gm.ArmourAmount <= 0)
         {
             plr.DamagePlayer(1f);
         }
     }
 }