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); }
public void __createCacheDataNight__() { if (_phase == CombatPhase.NIGHT) { RationModel ration = null; if (_GetRationData() != null) { ration = new RationModel(_ships_f, _GetRationData()); } _cache_opening_n = new NightCombatModel(this, _battleData.NightBattle, ration); _cache_hougeki_n = null; if (_battleData.NightBattle.Hougeki != null) { List <Hougeki <BattleAtackKinds_Night> > hougeki = _battleData.NightBattle.Hougeki; _cache_hougeki_n = new HougekiListModel(hougeki, _GetShipsDic()); } } }
public void __createCacheDataNight__() { if (this._phase != CombatPhase.NIGHT) { return; } RationModel ration = null; if (this._GetRationData() != null) { ration = new RationModel(this._ships_f, this._GetRationData()); } this._cache_opening_n = new NightCombatModel(this, this._battleData.NightBattle, ration); this._cache_hougeki_n = null; if (this._battleData.NightBattle.Hougeki != null) { List <Hougeki <BattleAtackKinds_Night> > hougeki = this._battleData.NightBattle.Hougeki; this._cache_hougeki_n = new HougekiListModel(hougeki, this._GetShipsDic()); } }
private void CheckNextAction() { if ((_isFriendActionExit && _isEnemyActionExit) || currentCmdActionPhase == null) { _nCurrentShellingCnt++; _clsState.AddState(InitCommandBuffer, UpdateCommandBuffer); return; } _actOnFleetAction = null; _clsNowHougekiList = null; _clsNowRaigeki = null; if (!_isFriendActionExit) { if (currentCmdActionPhase.Action_f != null) { if (currentCmdActionPhase.Action_f is HougekiListModel) { _actOnFleetAction = CheckNextAction; _clsNowHougekiList = (currentCmdActionPhase.Action_f as HougekiListModel); _clsState.AddState(InitShelling, UpdateShelling); } else { _actOnFleetAction = CheckNextAction; _clsNowRaigeki = (currentCmdActionPhase.Action_f as RaigekiModel); _clsState.AddState(InitTorpedo, UpdateTorpedo); } _isFriendActionExit = true; } else { _isFriendActionExit = true; CheckNextAction(); } } else { if (_isEnemyActionExit) { return; } if (currentCmdActionPhase.Action_e != null) { if (currentCmdActionPhase.Action_e is HougekiListModel) { _actOnFleetAction = CheckNextAction; _clsNowHougekiList = (currentCmdActionPhase.Action_e as HougekiListModel); _clsState.AddState(InitShelling, UpdateShelling); } else { _actOnFleetAction = CheckNextAction; _clsNowRaigeki = (currentCmdActionPhase.Action_e as RaigekiModel); _clsState.AddState(InitTorpedo, UpdateTorpedo); } _isEnemyActionExit = true; } else { _isEnemyActionExit = true; CheckNextAction(); } } }
private void CheckNextAction() { if ((this._isFriendActionExit && this._isEnemyActionExit) || this.currentCmdActionPhase == null) { this._nCurrentShellingCnt++; this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitCommandBuffer), new StatementMachine.StatementMachineUpdate(this.UpdateCommandBuffer)); return; } this._actOnFleetAction = null; this._clsNowHougekiList = null; this._clsNowRaigeki = null; if (!this._isFriendActionExit) { if (this.currentCmdActionPhase.Action_f != null) { if (this.currentCmdActionPhase.Action_f is HougekiListModel) { this._actOnFleetAction = new Action(this.CheckNextAction); this._clsNowHougekiList = (this.currentCmdActionPhase.Action_f as HougekiListModel); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitShelling), new StatementMachine.StatementMachineUpdate(this.UpdateShelling)); } else { this._actOnFleetAction = new Action(this.CheckNextAction); this._clsNowRaigeki = (this.currentCmdActionPhase.Action_f as RaigekiModel); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitTorpedo), new StatementMachine.StatementMachineUpdate(this.UpdateTorpedo)); } this._isFriendActionExit = true; return; } this._isFriendActionExit = true; this.CheckNextAction(); return; } else { if (this._isEnemyActionExit) { return; } if (this.currentCmdActionPhase.Action_e != null) { if (this.currentCmdActionPhase.Action_e is HougekiListModel) { this._actOnFleetAction = new Action(this.CheckNextAction); this._clsNowHougekiList = (this.currentCmdActionPhase.Action_e as HougekiListModel); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitShelling), new StatementMachine.StatementMachineUpdate(this.UpdateShelling)); } else { this._actOnFleetAction = new Action(this.CheckNextAction); this._clsNowRaigeki = (this.currentCmdActionPhase.Action_e as RaigekiModel); this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitTorpedo), new StatementMachine.StatementMachineUpdate(this.UpdateTorpedo)); } this._isEnemyActionExit = true; return; } this._isEnemyActionExit = true; this.CheckNextAction(); return; } }