/// <summary>
    /// Gets called everytime the player max health changes.
    /// </summary>

    private void HealthSystem_OnMaxHealthChanged(object sender, EventArgs e)
    {
        maxHealth = healthSystem.GetCurrentMaxHealth();

        currentHealth = healthSystem.GetCurrentHealth();

        if (OnMaxHealthChanged != null)
        {
            OnMaxHealthChanged(this, EventArgs.Empty);
        }
    }
    /// <summary>
    /// Sets the current health system and updates the local parameters.
    /// </summary>

    public void SetHealthSystem(HealthSystem healthSystem)
    {
        this.healthSystem = healthSystem;

        currentHealth = healthSystem.GetCurrentHealth();
        maxHealth     = healthSystem.GetCurrentMaxHealth();

        healthSystem.OnHealthChanged    += HealthSystem_OnHealthChanged;
        healthSystem.OnMaxHealthChanged += HealthSystem_OnMaxHealthChanged;

        Player.instance.levelSystemAnimation.OnLevelChanged += LevelSystemAnimation_OnLevelChanged;
    }