private void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) && _controlPanel.activeSelf == true)
        {
            _player.RecruitUnit(_unit[0]);
        }

        if (Input.GetKeyDown(KeyCode.R) && _controlPanel.activeSelf == true)
        {
            _player.RecruitUnit(_unit[1]);
        }

        if (_timeFromLastRecruit >= _recruitTime && _unitsToRecruit.Count > 0)
        {
            SpawnUnit(_unitsToRecruit.Dequeue());
            _timeFromLastRecruit = 0;

            UnitsToRecruitCountChanged?.Invoke(_unitsToRecruit.Count);
        }

        if (_timeFromLastRecruit <= _recruitTime)
        {
            _normalizedRecruitingProgress = _timeFromLastRecruit / _recruitTime;
            ProgressChanged?.Invoke(_normalizedRecruitingProgress);
        }

        _timeFromLastRecruit += Time.deltaTime;
    }
    private void AddInQueue(GameObject unit)
    {
        if (_unitsToRecruit.Count < 1)
        {
            _timeFromLastRecruit = 0;
        }

        Unit recruitedUnit = unit.GetComponent <Unit>();

        _unitsToRecruit.Enqueue(recruitedUnit);
        UnitsToRecruitCountChanged?.Invoke(_unitsToRecruit.Count);
    }