void OnTriggerEnter(Collider collid) { if (collid.gameObject.CompareTag("Leaf") && !bossBehavior.GetIsKnocked()) { float damage; if (collid.gameObject.GetComponent <MoveLeaf>() != null) { damage = collid.gameObject.GetComponent <MoveLeaf>().GetDamage(); } else { damage = collid.gameObject.GetComponent <MeleeAttackTrigger>().GetDamage(); } bossBehavior.BeingHit(); bossBehavior.LooseHp(damage); } }
void OnTriggerEnter(Collider collid) { if (collid.gameObject.CompareTag("Leaf") && !bossBehavior.GetIsKnocked()) { float damage; if (collid.gameObject.GetComponent <MoveLeaf>() != null) { damage = collid.gameObject.GetComponent <MoveLeaf>().GetDamage(); } else { damage = collid.gameObject.GetComponent <MeleeAttackTrigger>().GetDamage(); } //================================================ SoundController.instance.SelectYOKAI("Hurt"); //================================================ bossBehavior.BeingHit(); bossBehavior.LooseHp(damage); } }