private new void OnTriggerEnter2D(Collider2D col) { if (col.tag.Equals("Sword") && sword.damaging) { isHurt = true; hitpointBar.DecreaseBossHitpoint(sword.damage); } }
private new void OnTriggerEnter2D(Collider2D collision) { if (collision.tag.Equals("Laser")) { if (!light.enabled) { light.enabled = true; } hitpointBar.DecreaseBossHitpoint(1); } if (collision.gameObject.name == "Player") { Vector2 forceDirection = new Vector2(facingDirection.x, 1.0f); player.GetComponent <Rigidbody2D>().AddForce(forceDirection, ForceMode2D.Impulse); playerBar.DecreaseHitpoint(1); } }
private void OnTriggerStay2D(Collider2D col) { if (col.tag == "Sword" && sword.damaging && !isInvulnerable) { isHurt = true; hitpointBar.DecreaseBossHitpoint(2); isInvulnerable = true; } }
private new void OnTriggerEnter2D(Collider2D col) { if (col.tag.Equals("Sword") && sword.damaging && !isDark) { isHurt = true; hitpointBar.DecreaseBossHitpoint(sword.damage); } if (col.tag.Equals("Laser") && isDark) { isDark = false; TurnIntoNormalMode(); } }