void Awake() { instance = this; TBData.ClearEndData(); SettingDB settingDB = InitSetting(); if (enableCover) { CoverSystem.SetFullCoverDodgeBonus(fullCoverBonus); CoverSystem.SetHalfCoverDodgeBonus(halfCoverBonus); CoverSystem.SetExposedCritChanceBonus(exposedCritBonus); } //get the instance of each component and initiate them, the order in which these component matters PerkManager perkManager = (PerkManager)FindObjectOfType(typeof(PerkManager)); if (perkManager != null) { perkManager.Init(); } AbilityManagerUnit abManagerUnit = (AbilityManagerUnit)FindObjectOfType(typeof(AbilityManagerUnit)); if (abManagerUnit != null) { abManagerUnit.Init(); } AbilityManagerFaction abManagerFac = (AbilityManagerFaction)FindObjectOfType(typeof(AbilityManagerFaction)); if (abManagerFac != null) { abManagerFac.Init(); } TurnControl turnControl = (TurnControl)FindObjectOfType(typeof(TurnControl)); turnControl.Init(); if (settingDB != null) { turnControl.turnMode = settingDB.turnMode; turnControl.moveOrder = settingDB.moveOrder; } GridManager gridManager = (GridManager)FindObjectOfType(typeof(GridManager)); if (settingDB != null) { gridManager.generateGridOnStart = settingDB.generateGridOnStart; } gridManager.Init(); FactionManager factionManager = (FactionManager)FindObjectOfType(typeof(FactionManager)); if (settingDB != null) { factionManager.generateUnitOnStart = settingDB.generateUnitOnStart; } factionManager.Init(); CollectibleManager collectibleManager = (CollectibleManager)FindObjectOfType(typeof(CollectibleManager)); if (settingDB != null) { collectibleManager.generateCollectibleOnStart = settingDB.generateCollectibleOnStart; } collectibleManager.Init(); GridManager.SetupGridForFogOfWar(); OverlayManager overlayManager = (OverlayManager)FindObjectOfType(typeof(OverlayManager)); overlayManager.Init(); defaultShootObject = Resources.Load("ScenePrefab/DefaultShootObject", typeof(GameObject)) as GameObject; gamePhase = _GamePhase.Initialization; }