Example #1
0
    private void SlashKnife()
    {
        animator.SetBool("arrive", true);
        int amount;

        if (shield.GetShieldState())
        {
            amount = 0;
            Debug.Log("Shield");
            shield.ReSetShield();
        }
        else
        {
            amount = slash_damage * -1;
            Debug.Log("Non Shield" + "damage : " + amount);
            ShieldmanController.Instance.ChangeHealth(amount);
        }

        attack = true;
    }
Example #2
0
 // 추상화 예정
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         int amount;
         if (shield.GetShieldState())
         {
             amount = 0;
             Debug.Log("Shield");
             shield.ReSetShield();
             ShieldmanController.Instance.ChangeHealth(amount);
         }
         else
         {
             amount = damage * -1;
             Debug.Log("Non Shield" + "damage : " + amount);
             ShieldmanController.Instance.ChangeHealth(amount);
         }
         Destroy(gameObject);
     }
 }