protected override bool Init() { _clsNightCombat = BattleTaskManager.GetBattleManager().GetNightCombatData(); _clsHougekiList = BattleTaskManager.GetBattleManager().GetHougekiList_Night(); if (_clsHougekiList == null) { EndPhase(BattleUtils.NextPhase(BattlePhase.NightCombat)); ImmediateTermination(); } else { _nCurrentShellingCnt = 1; _clsState = new StatementMachine(); _prodShellingAttack = new ProdShellingAttack(); _vCameraOriginPos = BattleTaskManager.GetBattleCameras().fieldCameras[0].transform.position; if (!BattleTaskManager.GetIsSameBGM()) { KCV.Utils.SoundUtils.SwitchBGM((BGMFileInfos)BattleTaskManager.GetBattleManager().GetBgmId()); } _clsState.AddState(InitNightMessage, UpdateNightMessage); Transform transform = UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabSearchLightSceneController, Vector3.zero, Quaternion.identity) as Transform; _ctrlSearchLight = ((Component)transform).GetComponent <SearchLightSceneController>(); Transform transform2 = UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabFlareBulletSceneController, Vector3.zero, Quaternion.identity) as Transform; _ctrlFlareBullet = ((Component)transform2).GetComponent <FlareBulletSceneController>(); } return(true); }
protected override bool Init() { this._clsNightCombat = BattleTaskManager.GetBattleManager().GetNightCombatData(); this._clsHougekiList = BattleTaskManager.GetBattleManager().GetHougekiList_Night(); if (this._clsHougekiList == null) { this.EndPhase(BattleUtils.NextPhase(BattlePhase.NightCombat)); base.ImmediateTermination(); } else { this._nCurrentShellingCnt = 1; this._clsState = new StatementMachine(); this._prodShellingAttack = new ProdShellingAttack(); this._vCameraOriginPos = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0).get_transform().get_position(); if (!BattleTaskManager.GetIsSameBGM()) { KCV.Utils.SoundUtils.SwitchBGM((BGMFileInfos)BattleTaskManager.GetBattleManager().GetBgmId()); } this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitNightMessage), new StatementMachine.StatementMachineUpdate(this.UpdateNightMessage)); Transform transform = Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabSearchLightSceneController, Vector3.get_zero(), Quaternion.get_identity()) as Transform; this._ctrlSearchLight = transform.GetComponent <SearchLightSceneController>(); Transform transform2 = Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabFlareBulletSceneController, Vector3.get_zero(), Quaternion.get_identity()) as Transform; this._ctrlFlareBullet = transform2.GetComponent <FlareBulletSceneController>(); } return(true); }
protected override bool UnInit() { base.UnInit(); _prodShellingFormationJudge = null; if (_prodShellingAttack != null) { _prodShellingAttack.Dispose(); } _prodShellingAttack = null; _clsNowHougekiList = null; Mem.DelIDisposableSafe(ref _prodShellingTorpedo); return(true); }
protected override bool Init() { if (!BattleTaskManager.GetBattleManager().IsExistHougekiPhase_Day()) { ImmediateTermination(); EndPhase(BattleUtils.NextPhase(BattlePhase.Shelling)); } else { _listCmdActionList = BattleTaskManager.GetBattleManager().GetHougekiData_Day(); _nCurrentShellingCnt = 0; _actOnFleetAction = null; _prodShellingFormationJudge = ProdShellingFormationJudge.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdShellingFormationJudge).GetComponent <ProdShellingFormationJudge>(), BattleTaskManager.GetBattleManager(), BattleTaskManager.GetBattleCameras().cutInCamera.transform); _prodShellingAttack = new ProdShellingAttack(); _clsState = new StatementMachine(); _clsState.AddState(InitFormationJudge, UpdateFormationJudge); } return(true); }