private void AddHamster()
        {
            Hamster hamster = Instantiate(_prefHamster, new Vector3(0, 0), Quaternion.identity, transform);

            hamster.gameObject.SetActive(false);
            hamster.Init(_health, _score);

            _poolHamster.Enqueue(hamster);
        }
        private void SpawnHamsters()
        {
            _complexityGame.ChangeComplexity(_score.Value);

            for (int i = 0; i < Random.Range(_complexityGame.MinCountEnemy, _complexityGame.MaxCountEnemy); i++)
            {
                Hamster hamster = _poolHamsters.GetUnit();
                hamster.transform.position = _poolHamsterHoles.GetPositionHole();

                _selectionHamster.SelectionRandomHamster(hamster);

                _listHamsters.Add(hamster);
            }
        }
        public Hamster GetUnit()
        {
            if (_poolHamster.Count == 0)
            {
                AddHamster();
            }

            Hamster hamster = _poolHamster.Dequeue();

            hamster.gameObject.SetActive(true);

            _poolHamster.Enqueue(hamster);

            return(hamster);
        }
        public void SelectionRandomHamster(Hamster hamster)
        {
            DataHamster dataHamster = _listDataHamster[Random.Range(0, _listDataHamster.Count)];

            hamster.InitDataHamster(dataHamster);
        }
 public void DropUnit(Hamster hamster)
 {
     hamster.gameObject.SetActive(false);
 }