void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "spike" && Health > 0 && Invincible == false) { _hurt = true; //call powerup and be slower //be slower } if (collider.GetComponent <Powerup>() != null) { //se om det er invici eller speed up _powerUp = collider.GetComponent <Powerup>(); _powerUp.Affect(this); _powerUped = true; } if (collider.name == "Angry Mob") { Health = 0; Dead = true; } else if (collider.GetComponent <WeaponMove> () != null) { _hurt = true; } }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "spike" && Health > 0 && Invincible == false) { _hurt = true; //call powerup and be slower //be slower } if (collider.GetComponent<Powerup>() != null) { //se om det er invici eller speed up _powerUp = collider.GetComponent<Powerup>(); _powerUp.Affect(this); _powerUped = true; } if (collider.name == "Angry Mob") { Health = 0; Dead = true; } else if (collider.GetComponent<WeaponMove> () != null) { _hurt = true; } }