Пример #1
0
        private void SpawnAttackMinion(TowerController towerController)
        {
            MinionController minionController =
                ObjectPool.Instance.Get <MinionController>(_prefab, _attackSpawnTransform.position);

            minionController.LoyaltyState = _loyaltyState;
            minionController.SetAim(towerController);
        }
Пример #2
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit))
     {
         if (hit.transform.TryGetComponent(out TowerController towerController))
         {
             _selectedTowerController = towerController;
         }
     }
 }
Пример #3
0
        private IEnumerator AttackCoroutine(TowerController towerController)
        {
            var waiter = new WaitForSeconds(_attackSpawnDelay);

            for (int i = 0; i < _preparedMinionCount / 2; i++)
            {
                _preparedMinionCount--;
                _minionCountText.text = _preparedMinionCount.ToString();
                SpawnAttackMinion(towerController);
                yield return(waiter);
            }
        }
Пример #4
0
 public void Attack(TowerController towerController)
 {
     StartCoroutine(AttackCoroutine(towerController));
 }