private void ClearGameProgress() { currentLvl = 0; currentGold = 0; unitCredits = null; currentBattleLogicController = null; currentBattleUiController = null; waitingForBattleLevelLoad = false; }
public void Initialize(BattleUIController battleUIController, Dictionary <UnitType, int> unitCredits) { currentUnitCredits = new Dictionary <UnitType, int>(); currentUnitCredits[UnitType.FOOTMAN] = unitCredits[UnitType.FOOTMAN]; currentUnitCredits[UnitType.HEALER] = unitCredits[UnitType.HEALER]; currentUnitCredits[UnitType.ARCHER] = unitCredits[UnitType.ARCHER]; this.battleUIController = battleUIController; ScanUnits(); }
private void SetUpNewBattle() { BattleLogicController battleLogicController = Instantiate(battleLogicControllerPrefab).GetComponent <BattleLogicController>(); BattleUIController battleUiController = Instantiate(battleUIControllerPrefab).GetComponent <BattleUIController>(); currentBattleLogicController = battleLogicController; currentBattleUiController = battleUiController; battleUiController.Initialize(currentBattleLogicController, unitCredits, levelConfigurations[currentLvl - 1]); battleLogicController.Initialize(currentBattleUiController, unitCredits); waitingForBattleLevelLoad = false; }