private void Start() { _camera = Camera.main; _strategyMapper = new GameStrategyMapper(); if (_statsHolder != null) { _monsterStats = _statsHolder.FindObjectByType <MonsterStats>(); } }
private void Awake() { var monsterPools = statsHolder.FindObjectByType <MonsterStats>(); _blockManager = GetComponentInChildren <MapBlockManager>(); _mapGrid = GetComponentInChildren <MapGrid>(); _gameInputManager = GetComponentInChildren <GameInputManager>(); _gameInteractorCtrl = GetComponentInChildren <InGameUICtrl>(); _poolManager = GetComponentInChildren <PoolManager>(); _gameUnitManager = GetComponentInChildren <GameUnitManager>(); _levelDesignManager = GetComponentInChildren <LevelDesignManager>(); _headView = GetComponentInChildren <HeaderView>(); _mapBlockBottomView = GetComponentInChildren <MapBlockBottomView>(); _mapGrid.SetUp(); _gameInputManager.SetUp(_mapGrid, _blockManager); _gameUnitManager.SetUp(_blockManager, _mapGrid, poolingTheme.total); _levelDesignManager.Init(_gameUnitManager, _blockManager, _mapGrid, monsterPools); _gameInteractorCtrl.SetUp(_gameInputManager, _gameUnitManager, _levelDesignManager, _mapGrid, _blockManager, poolingTheme, statsHolder); }
private ConstructionView.DisplayUIComp[] GetInitialTowerPlacement() { List <TowerStats> firstLevelTowers = _statHolder.FindObjectByType <TowerStats>(); firstLevelTowers = firstLevelTowers.FindAll(x => x.level == 1); int towerLength = firstLevelTowers.Count; ConstructionView.DisplayUIComp[] uiCompArray = new ConstructionView.DisplayUIComp[towerLength]; for (int i = 0; i < towerLength; i++) { int index = i; ConstructionView.DisplayUIComp uiComp = FormTowerUIComp("$" + firstLevelTowers[i].cost, firstLevelTowers[i].id, firstLevelTowers[i].sprite, () => { SelectTowerToBuild(firstLevelTowers[index].id); }); uiCompArray[i] = uiComp; } return(uiCompArray); }