Пример #1
0
    /// <summary>
    /// 被敌人攻击
    /// </summary>
    public void GetHit(int damage)
    {
        if (!isRoll)
        {
            Debug.Log("Damage" + damage);
            health -= damage;

            if (health > 0)
            {
                audios.AudioPlay("PlayerGetHit");
                animator.Play(PlayerAnimationManager.Instance.beHit, 0, 0);
            }
            else
            {
                Die();
            }
        }

        if (isDrinking)
        {
            var currentWeapon = WeaponManager.Instance.weaponList[WeaponManager.Instance.weaponNum];
            currentWeapon.SetActive(true);
            bloodPotion.gameObject.SetActive(false);
            isHide = true;
        }
    }