using System;
using UnityEngine;
using Random = UnityEngine.Random;

public class Test_TakeDamage : MonoBehaviour
{

    [SerializeField]
    Bar _bar;

    void Start()
    {
        _bar.FillTo(1);
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            _bar.TakeDamage(Random.Range(1,15));
        }    
        
        if (Input.GetKeyDown(KeyCode.R))
        {
            _bar.Replenish();
        }    


        
    }
}
