예제 #1
0
 private new void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag.Equals("Sword") && sword.damaging)
     {
         isHurt = true;
         hitpointBar.DecreaseBossHitpoint(sword.damage);
     }
 }
예제 #2
0
    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);
        }
    }
예제 #3
0
 private void OnTriggerStay2D(Collider2D col)
 {
     if (col.tag == "Sword" && sword.damaging && !isInvulnerable)
     {
         isHurt = true;
         hitpointBar.DecreaseBossHitpoint(2);
         isInvulnerable = true;
     }
 }
예제 #4
0
    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();
        }
    }