Ejemplo n.º 1
0
    public void TakeDamage(int amount)
    {
        if (!isServer)
        {
            return;
        }

        if (anim.GetBool("Death") != true)
        {
            currentHealth -= amount;
        }

        if (currentHealth <= 0)
        {
            int         id     = gameObject.GetComponent <PlayerMageController>().playerId;
            LobbyPlayer player = LobbyPlayerList._instance._players[id];
            if (player.score < 3)
            {
                player.IncrementScore();
            }
            RpcRespawn();
            currentHealth = maxHealth;
            GameManager.s_Singleton.UpdateHudScore();
        }
    }