コード例 #1
0
    public void SetDamage(float damage, bool playSound)
    {
        life -= damage;
        playerHealthBar.SetCurrentPlayerHealth(maxLife, life);

        if (playSound)
        {
            audioPlayer.PlaySFX(Random.Range(0, 2), 0.3f, Random.Range(0.96f, 1.04f));              //Thor receive damage Sound
        }
        if (life <= 0 && moveStates != MoveStates.Dead)
        {
            audioPlayer.PlaySFX(6, 0.3f, 1);    //Thor Death Sound
            SetDead();
        }
    }