示例#1
0
    public void TakeDamage(int amount, Vector3 hitPoint, int playerNumber)
    {
        if (isDead)
        {
            return;
        }

        enemyAudio.Play();

        currentHealth -= amount;

        hitParticles.transform.position = hitPoint;
        hitParticles.Play();

        if (currentHealth <= 0)
        {
            Death();
            if (playerNumber == 1)
            {
                ScoreManager.score1 += scoreValue;
            }
            else
            {
                ScoreManager.score2 += scoreValue;
            }
            Debug.Log("morreu" + " " + scoreValue);
            LogManager.AddPlayerScoreMade(playerNumber, scoreValue);
            LogManager.playerScoreMadePerSecond[playerNumber - 1] += scoreValue;
        }
    }