Пример #1
0
    public void CmdTakeDamage(float damage)
    {
        this.currentHealth = Mathf.Clamp(currentHealth - damage, 0, MaxHealth);
        healthUI.ChangeHealthUI(healthAsPercentage);

        if (currentHealth <= 0)
        {
            if (LobbyManager.s_Singleton != null)
            {
                transform.position = StartingPos;
                this.currentHealth = MaxHealth;
                healthUI.ChangeHealthUI(healthAsPercentage);
            }
        }
    }