private bool InitMoveCameraTo2D(object data)
        {
            BattleFieldCamera       cam                  = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
            BattleShips             battleShips          = BattleTaskManager.GetBattleShips();
            ProdDetectionStartCutIn pdsc                 = ProdDetectionStartCutIn.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn.GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.get_transform());
            ShipModel_Battle        detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(this._clsSakuteki.planes_f, true);
            UIBattleShip            uIBattleShip         = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips.get_Item(detectionPrimaryShip.Index);
            Vector3 vector           = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.get_zero()) * 30f;
            Vector3 fixChasingCamera = new Vector3(uIBattleShip.pointOfGaze.x, uIBattleShip.pointOfGaze.y, uIBattleShip.pointOfGaze.z + vector.z);

            cam.pointOfGaze = uIBattleShip.pointOfGaze;
            cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
            cam.SetFixChasingCamera(fixChasingCamera);
            Vector3   endCamPos = new Vector3(uIBattleShip.pointOfGaze.x, 50f, uIBattleShip.pointOfGaze.z + vector.z * 6f);
            Transform transform = uIBattleShip.get_transform();
            Vector3   position  = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(0).get_transform().get_position();

            this._psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple), null, false, false).GetComponent <ParticleSystem>();
            this._psDetectionRipple.get_transform().set_parent(transform);
            this._psDetectionRipple.get_transform().set_position(new Vector3(position.x, position.y + 0.01f, position.z));
            this._psDetectionRipple.Play();
            pdsc.Play().Subscribe(delegate(bool _)
            {
                cam.get_transform().LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic);
                Mem.DelComponentSafe <ProdDetectionStartCutIn>(ref pdsc);
            });
            return(false);
        }
Пример #2
0
        private IEnumerator CreateAerialCombatCutIn(IObserver <bool> observer)
        {
            BattleCameras           cams         = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera       inCam        = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera efCam        = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            BattleShips             _battleShips = BattleTaskManager.GetBattleShips();

            _prodSupportAerialPhase1 = ProdSupportAerialPhase1.Instantiate(fShips: _battleShips.dicFriendBattleShips, eShips: _battleShips.dicEnemyBattleShips, prefab: Resources.Load <ProdSupportAerialPhase1>("Prefabs/Battle/Production/SupportingFire/ProdSupportAerialPhase1"), model: _clsAerial, parent: cams.cutInCamera.transform.parent);
            if (_clsAerial.GetPlanes(is_friend: true) != null && _clsAerial.GetPlanes(is_friend: false) != null)
            {
                inCam.isCulling = true;
                efCam.isCulling = true;
            }
            else if (_clsAerial.GetPlanes(is_friend: true) != null)
            {
                efCam.isCulling = false;
            }
            yield return(new WaitForEndOfFrame());

            _prodSupportAerialPhase2 = ProdSupportAerialPhase2.Instantiate(Resources.Load <ProdSupportAerialPhase2>("Prefabs/Battle/Production/SupportingFire/ProdSupportAerialPhase2"), _clsAerial, inCam.transform);
            yield return(new WaitForEndOfFrame());

            _prodSupportAerialPhase2.CreateHpGauge(FleetType.Enemy);
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
        private bool InitFriendFleetAdvent(object data)
        {
            this._dicPSClouds.get_Item(FleetType.Friend).SetActive(true);
            this._dicPSClouds.get_Item(FleetType.Friend).Play();
            BattleFieldCamera cam          = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
            UIBattleShip      uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(0);
            Vector3           position     = BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Friend).get_position();

            position.y = uIBattleShip.pointOfGaze.y;
            ShipUtils.PlayBattleStartVoice(uIBattleShip.shipModel);
            cam.ReqViewMode(CameraActor.ViewMode.RotateAroundObject);
            cam.SetRotateAroundObjectCamera(position, BattleDefines.FLEET_ADVENT_START_CAM_POS.get_Item(0), -10f);
            List <float> rotDst = this.CalcCloseUpCamDist(cam.rotateDistance, 30f);

            cam.get_transform().LTValue(cam.rotateDistance, rotDst.get_Item(0), 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
            {
                cam.rotateDistance = x;
            }).setOnComplete(delegate
            {
                cam.get_transform().LTValue(cam.rotateDistance, rotDst.get_Item(1), 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
                {
                    cam.rotateDistance = x;
                }).setOnComplete(delegate
                {
                    this.EndPhase(BattleUtils.NextPhase(BattlePhase.FleetAdvent));
                });
            });
            return(false);
        }
        private bool InitFriendFleetAdvent(object data)
        {
            ((Component)_dicPSClouds[FleetType.Friend]).SetActive(isActive: true);
            _dicPSClouds[FleetType.Friend].Play();
            BattleFieldCamera cam          = BattleTaskManager.GetBattleCameras().fieldCameras[0];
            UIBattleShip      uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips[0];
            Vector3           position     = BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Friend].position;
            Vector3           pointOfGaze  = uIBattleShip.pointOfGaze;

            position.y = pointOfGaze.y;
            ShipUtils.PlayBattleStartVoice(uIBattleShip.shipModel);
            cam.ReqViewMode(CameraActor.ViewMode.RotateAroundObject);
            cam.SetRotateAroundObjectCamera(position, BattleDefines.FLEET_ADVENT_START_CAM_POS[0], -10f);
            List <float> rotDst = CalcCloseUpCamDist(cam.rotateDistance, 30f);

            cam.transform.LTValue(cam.rotateDistance, rotDst[0], 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
            {
                cam.rotateDistance = x;
            })
            .setOnComplete((Action) delegate
            {
                cam.transform.LTValue(cam.rotateDistance, rotDst[1], 1f).setEase(BattleDefines.FLEET_ADVENT_FLEET_CLOSEUP_EASEING_TYPE).setOnUpdate(delegate(float x)
                {
                    cam.rotateDistance = x;
                })
                .setOnComplete((Action) delegate
                {
                    EndPhase(BattleUtils.NextPhase(BattlePhase.FleetAdvent));
                });
            });
            return(false);
        }
Пример #5
0
        private bool _initTorpedoExplosion(object data)
        {
            CenterLine.alpha = 1f;
            BattleField   battleField   = BattleTaskManager.GetBattleField();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            if (_prodTorpedoSalvoPhase2 != null)
            {
                _prodTorpedoSalvoPhase2.deleteTorpedoWake();
                UnityEngine.Object.Destroy(_prodTorpedoSalvoPhase2.transform.gameObject);
            }
            _prodTorpedoSalvoPhase2 = null;
            battleCameras.SetVerticalSplitCameras(isSplit: true);
            battleCameras.friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            battleCameras.enemyFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Friend].position;

            battleCameras.friendFieldCamera.transform.position      = new Vector3(-51f, 8f, 90f);
            battleCameras.friendFieldCamera.transform.localRotation = Quaternion.Euler(new Vector3(10.5f, 70f, 0f));
            Vector3 position2 = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Enemy].position;

            battleCameras.enemyFieldCamera.transform.position      = new Vector3(-51f, 8f, -90f);
            battleCameras.enemyFieldCamera.transform.localRotation = Quaternion.Euler(new Vector3(10.5f, 111f, 0f));
            BattleTaskManager.GetBattleShips().SetBollboardTarget(isFriend: false, battleCameras.enemyFieldCamera.transform);
            _prodTorpedoSalvoPhase3.Play(_onTorpedoExplosionFinished);
            return(false);
        }
Пример #6
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            this._prodAerialCombatP2.get_gameObject().SetActive(true);
            Object.Destroy(this._prodAerialCombatP1.get_gameObject());
            cutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask = Generics.Layers.CutIn;
            cutInCamera.depth             = 5f;
            cutInEffectCamera.depth       = 4f;
            cutInEffectCamera.glowEffect.set_enabled(true);
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(false);
            SlotitemModel_Battle touchPlane  = this._clsKoukuu1.GetTouchPlane(true);
            SlotitemModel_Battle touchPlane2 = this._clsKoukuu1.GetTouchPlane(false);

            this._prodAerialTouchPlane = ProdAerialTouchPlane.Instantiate(Resources.Load <ProdAerialTouchPlane>("Prefabs/Battle/Production/AerialCombat/ProdAerialTouchPlane"), cutInCamera2.get_transform());
            this._prodAerialTouchPlane.get_transform().set_localPosition(Vector3.get_zero());
            this._prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            this._prodAerialCombatP2.Play(new Action(this._onAircraftCombatFinished), dicFriendBattleShips, dicEnemyBattleShips);
            return(false);
        }
Пример #7
0
 private static Vector3?GetShipPointOfGaze(ShipModel_Battle model)
 {
     if (model != null)
     {
         return(BattleTaskManager.GetBattleShips().dicFriendBattleShips[model.Index].pointOfGaze);
     }
     return(null);
 }
Пример #8
0
        public virtual void PlayAttack(HougekiModel model, int nCurrentShellingCnt, bool isNextAttack, bool isSkipAttack, Action callback)
        {
            if (model == null)
            {
                Dlg.Call(ref callback);
            }
            BattleTaskManager.GetTorpedoHpGauges().Hide();
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            this.hougekiModel   = model;
            this._actOnFinished = callback;
            this._isNextAttack  = isNextAttack;
            this._isSkipAttack  = isSkipAttack;
            this.SetDirectionSubjects(this.hougekiModel);
            this._nCurrentAttackCnt = nCurrentShellingCnt;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.ResetFleetAnchorPosition();
            this.CorFleetAnchorDifPosition();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(false);
            BattleShips battleShips2 = BattleTaskManager.GetBattleShips();

            battleShips2.SetBollboardTarget(true, battleCameras.fieldCameras.get_Item(0).get_transform());
            battleShips2.SetBollboardTarget(false, battleCameras.fieldCameras.get_Item(1).get_transform());
            battleShips2.SetTorpedoSalvoWakeAngle(false);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = cutInEffectCamera.get_transform().FindChild("TorpedoLine/OverlayLine").GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            battleFieldCamera.clearFlags  = 1;
            battleFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers();
            battleFieldCamera.eyePosition = this.CalcAttackerCamStartPos;
            battleCameras.SwitchMainCamera(FleetType.Friend);
            BattleFieldCamera battleFieldCamera2 = battleCameras.fieldCameras.get_Item(1);

            battleFieldCamera2.eyePosition = new Vector3(0f, 4f, 0f);
            battleFieldCamera2.eyeRotation = Quaternion.get_identity();
            battleFieldCamera2.fieldOfView = 30f;
            this.SetFieldCamera(true, this.CalcCamPos(true, false), this._listBattleShips.get_Item(0).spPointOfGaze);
            this.SetDimCamera(true, battleFieldCamera.get_transform());
            this.subjectShipLayerFmAnD   = Generics.Layers.FocusDim;
            this.subjectStandingPosFmAnD = StandingPositionType.Advance;
            BattleTaskManager.GetPrefabFile().circleHPGauge.get_transform().localScaleZero();
            this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitAttackerFocus), new StatementMachine.StatementMachineUpdate(this.UpdateAttackerFocus));
        }
        public virtual void PlayAttack(HougekiModel model, int nCurrentShellingCnt, bool isNextAttack, bool isSkipAttack, Action callback)
        {
            if (model == null)
            {
                Dlg.Call(ref callback);
            }
            BattleTaskManager.GetTorpedoHpGauges().Hide();
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            hougekiModel   = model;
            _actOnFinished = callback;
            _isNextAttack  = isNextAttack;
            _isSkipAttack  = isSkipAttack;
            SetDirectionSubjects(hougekiModel);
            _nCurrentAttackCnt = nCurrentShellingCnt;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.ResetFleetAnchorPosition();
            CorFleetAnchorDifPosition();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(isSplit: false);
            BattleShips battleShips2 = BattleTaskManager.GetBattleShips();

            battleShips2.SetBollboardTarget(isFriend: true, battleCameras.fieldCameras[0].transform);
            battleShips2.SetBollboardTarget(isFriend: false, battleCameras.fieldCameras[1].transform);
            battleShips2.SetTorpedoSalvoWakeAngle(isSet: false);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            battleFieldCamera.clearFlags  = CameraClearFlags.Skybox;
            battleFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers();
            battleFieldCamera.eyePosition = CalcAttackerCamStartPos;
            battleCameras.SwitchMainCamera(FleetType.Friend);
            BattleFieldCamera battleFieldCamera2 = battleCameras.fieldCameras[1];

            battleFieldCamera2.eyePosition = new Vector3(0f, 4f, 0f);
            battleFieldCamera2.eyeRotation = Quaternion.identity;
            battleFieldCamera2.fieldOfView = 30f;
            SetFieldCamera(isAttacker: true, CalcCamPos(isAttacker: true, isPointOfGaze: false), _listBattleShips[0].spPointOfGaze);
            SetDimCamera(isAttacker: true, battleFieldCamera.transform);
            subjectShipLayerFmAnD   = Generics.Layers.FocusDim;
            subjectStandingPosFmAnD = StandingPositionType.Advance;
            BattleTaskManager.GetPrefabFile().circleHPGauge.transform.localScaleZero();
            _clsState.AddState(InitAttackerFocus, UpdateAttackerFocus);
        }
Пример #10
0
 private bool InitFormationJudge(object data)
 {
     _prodShellingFormationJudge.Play(delegate
     {
         BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
         BattleTaskManager.GetBattleShips().SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
         BattleTaskManager.GetBattleShips().RadarDeployment(isDeploy: false);
     }, OnFormationJudgeFinished);
     return(false);
 }
Пример #11
0
        private void InitCameraSettingsForEnemyFocus()
        {
            BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[0];

            battleFieldCamera.transform.LTCancel();
            Vector3 vector = battleFieldCamera.pointOfGaze = BattleTaskManager.GetBattleShips().flagShipEnemy.pointOfGaze;

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            Vector3 fixChasingCamera = CalcCameraFleetFocusPos(_iResult);

            battleFieldCamera.SetFixChasingCamera(fixChasingCamera);
        }
 private bool _initTorpedoCutInNInjection(object data)
 {
     BattleTaskManager.GetBattleShips().SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
     Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.CreateTorpedoCutIn(observer)).Subscribe(delegate(bool _)
     {
         this._prodTorpedoCutIn.Play(delegate
         {
             this._onTorpedoCutInNInjectionFinished();
         });
     });
     return(false);
 }
 private bool InitWithdrawalSelection(object data)
 {
     _prodWithdrawalDecisionSelection.Play(delegate
     {
         BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
         ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
         observerAction.Executions();
         BattleField battleField = BattleTaskManager.GetBattleField();
         battleField.ResetFleetAnchorPosition();
         battleField.enemySeaLevel.SetActive(isActive: true);
         battleField.ReqTimeZone(KCV.Battle.Utils.TimeZone.Night, BattleTaskManager.GetSkyType());
         battleField.AlterWaveDirection(FleetType.Friend, FleetType.Friend);
         battleField.AlterWaveDirection(FleetType.Enemy, FleetType.Enemy);
         BattleShips battleShips = BattleTaskManager.GetBattleShips();
         battleShips.RadarDeployment(isDeploy: false);
         battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
         battleShips.SetStandingPosition(StandingPositionType.OneRow);
         battleShips.SetLayer(Generics.Layers.ShipGirl);
         BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();
         battleCameras.InitEnemyFieldCameraDefault();
         battleCameras.SetVerticalSplitCameras(isSplit: false);
         if (!battleCameras.isSplit)
         {
             battleCameras.SetSplitCameras(isSplit: true);
         }
         battleCameras.ResetFieldCamSettings(FleetType.Friend);
         battleCameras.ResetFieldCamSettings(FleetType.Enemy);
         battleCameras.fieldDimCameraEnabled(isEnabled: false);
         BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[0];
         battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
         battleFieldCamera.SetFixCamera(_dicSplitCameraPos[FleetType.Friend], _dicSplitCameraRot[FleetType.Friend]);
         battleFieldCamera.cullingMask = battleCameras.GetDefaultLayers();
         battleFieldCamera             = BattleTaskManager.GetBattleCameras().fieldCameras[1];
         battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
         battleFieldCamera.SetFixCamera(_dicSplitCameraPos[FleetType.Enemy], _dicSplitCameraRot[FleetType.Enemy]);
         battleFieldCamera.cullingMask = battleCameras.GetEnemyCamSplitLayers();
         BattleShips battleShips2      = BattleTaskManager.GetBattleShips();
         battleShips2.SetBollboardTarget(isFriend: true, battleCameras.fieldCameras[0].transform);
         battleShips2.SetBollboardTarget(isFriend: false, battleCameras.fieldCameras[1].transform);
         battleShips2.SetTorpedoSalvoWakeAngle(isSet: false);
         BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
         cutInEffectCamera.isCulling = false;
         UITexture component         = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();
         if (component != null)
         {
             component.alpha = 0f;
         }
         BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
     }, OnDecideWithdrawalButton);
     return(false);
 }
        private bool InitEnemyFleetFocus(object data)
        {
            this.SetEnemyShipsDrawType(this._iResult);
            BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
            Vector3           pointOfGaze       = BattleTaskManager.GetBattleShips().flagShipEnemy.pointOfGaze;
            Vector3           vector            = Vector3.Lerp(battleFieldCamera.eyePosition, pointOfGaze, 0.3f);

            battleFieldCamera.get_transform().LTMove(vector, 2.7f).setEase(LeanTweenType.linear);
            this._tpFocusPoint = new Tuple <Vector3, float>(vector, Vector3.Distance(Vector3.Lerp(battleFieldCamera.eyePosition, vector, 0.7f), vector));
            ProdCloud prodCloud = BattleTaskManager.GetPrefabFile().prodCloud;

            prodCloud.Play(this.GetFleetFocusAnim(this._iResult), null, null);
            return(false);
        }
Пример #15
0
 protected virtual void OnFinished()
 {
     if (this._clsHougekiModel.Defender.DamageEventAfter == DamagedStates.Megami || this._clsHougekiModel.Defender.DamageEventAfter == DamagedStates.Youin)
     {
         BattleTaskManager.GetBattleShips().Restored(this._clsHougekiModel.Defender);
     }
     else
     {
         BattleTaskManager.GetBattleShips().UpdateDamageAll(this._clsHougekiModel);
     }
     this.Reset();
     this._isFinished = true;
     Dlg.Call(ref this._actOnFinished);
 }
Пример #16
0
        protected virtual void SetDirectionSubjects(HougekiModel model)
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            this._listBattleShips.Add((!model.Attacker.IsFriend()) ? battleShips.dicEnemyBattleShips.get_Item(model.Attacker.Index) : battleShips.dicFriendBattleShips.get_Item(model.Attacker.Index));
            if (this.isProtect)
            {
                this._listBattleShips.Add((!model.Defender.IsFriend()) ? battleShips.flagShipEnemy : battleShips.flagShipFriend);
                this._listBattleShips.Add((!model.Defender.IsFriend()) ? battleShips.dicEnemyBattleShips.get_Item(model.Defender.Index) : battleShips.dicFriendBattleShips.get_Item(model.Defender.Index));
            }
            else
            {
                this._listBattleShips.Add((!model.Defender.IsFriend()) ? battleShips.dicEnemyBattleShips.get_Item(model.Defender.Index) : battleShips.dicFriendBattleShips.get_Item(model.Defender.Index));
            }
            this.subjectStandingPosFmAnD = StandingPositionType.Advance;
        }
        private void SetEnemyShipsDrawType(ProdDetectionResultCutIn.AnimationList iList)
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            switch (iList)
            {
            case ProdDetectionResultCutIn.AnimationList.DetectionLost:
            case ProdDetectionResultCutIn.AnimationList.DetectionNotFound:
                battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Silhouette);
                break;

            case ProdDetectionResultCutIn.AnimationList.DetectionSucces:
                battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
                break;
            }
        }
        protected override bool Init()
        {
            if (!BattleTaskManager.GetBattleShips().isInitialize)
            {
                return(false);
            }
            this._dicPSClouds = BattleTaskManager.GetBattleField().dicParticleClouds;
            Vector3 position = BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Friend).get_position();

            position.y = 20f;
            this._dicPSClouds.get_Item(FleetType.Friend).get_transform().set_position(position);
            position   = BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Enemy).get_position();
            position.y = 20f;
            this._dicPSClouds.get_Item(FleetType.Enemy).get_transform().set_position(position);
            this._clsState = new StatementMachine();
            this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitFriendFleetAdvent), new StatementMachine.StatementMachineUpdate(this.UpdateFriendFleetAdvent));
            return(true);
        }
        protected override bool Init()
        {
            if (!BattleTaskManager.GetBattleShips().isInitialize)
            {
                return(false);
            }
            _dicPSClouds = BattleTaskManager.GetBattleField().dicParticleClouds;
            Vector3 position = BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Friend].position;

            position.y = 20f;
            ((Component)_dicPSClouds[FleetType.Friend]).transform.position = position;
            position   = BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Enemy].position;
            position.y = 20f;
            ((Component)_dicPSClouds[FleetType.Enemy]).transform.position = position;
            _clsState = new StatementMachine();
            _clsState.AddState(InitFriendFleetAdvent, UpdateFriendFleetAdvent);
            return(true);
        }
Пример #20
0
        private bool _initSupportFleetAdmission(object data)
        {
            BattleTaskManager.GetBattleField().ResetFleetAnchorPosition();
            BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.RadarDeployment(isDeploy: false);
            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
            Observable.FromCoroutine((IObserver <bool> observer) => CreateCutIn(observer)).Subscribe(delegate
            {
                _prodSupportCutIn.Play(delegate
                {
                    _onSupportFleetAdmissionFinished();
                });
            });
            return(false);
        }
Пример #21
0
        private bool _initSupportAerialPhase2(object data)
        {
            BattleCutInCamera              cutInCamera         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2        = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera   = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShip  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            Object.Destroy(_prodSupportAerialPhase1.gameObject);
            cutInCamera.cullingMask              = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask        = Generics.Layers.CutIn;
            cutInCamera.depth                    = 5f;
            cutInEffectCamera.depth              = 4f;
            cutInEffectCamera.glowEffect.enabled = true;
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(isSplit: false);
            _prodSupportAerialPhase2.Play(_onSupportAerialFinishedPhase2);
            return(false);
        }
        private Vector3 CalcCameraFleetFocusPos(ProdDetectionResultCutIn.AnimationList iList)
        {
            Vector3 result = Vector3.get_zero();

            switch (iList)
            {
            case ProdDetectionResultCutIn.AnimationList.DetectionLost:
            case ProdDetectionResultCutIn.AnimationList.DetectionNotFound:
            case ProdDetectionResultCutIn.AnimationList.DetectionSucces:
            {
                Vector3 pointOfGaze = BattleTaskManager.GetBattleShips().flagShipEnemy.pointOfGaze;
                result   = BattleDefines.FLEET_ADVENT_START_CAM_POS.get_Item(1);
                result.y = pointOfGaze.y;
                break;
            }
            }
            return(result);
        }
Пример #23
0
        private bool _initAircraftSecondPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            this._prodAerialSecondP2.get_gameObject().SetActive(true);
            Object.Destroy(this._prodAerialSecondP1.get_gameObject());
            cutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask = Generics.Layers.CutIn;
            cutInCamera.depth             = 5f;
            cutInEffectCamera.depth       = 4f;
            cutInEffectCamera.glowEffect.set_enabled(true);
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(false);
            this._prodAerialSecondP2.Play(new Action(this._onAircraftSecondFinished), dicFriendBattleShips, dicEnemyBattleShips);
            return(false);
        }
Пример #24
0
        private bool _initSupportTorpedoPhase2(object data)
        {
            BattleField   battleField   = BattleTaskManager.GetBattleField();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Friend].position;

            battleCameras.friendFieldCamera.transform.position      = new Vector3(-38f, 8f, -74f);
            battleCameras.friendFieldCamera.transform.localRotation = Quaternion.Euler(new Vector3(9.5f, 137.5f, 0f));
            BattleTaskManager.GetBattleShips().SetBollboardTarget(isFriend: false, battleCameras.friendFieldCamera.transform);
            if (_prodSupportTorpedoP1 != null)
            {
                _prodSupportTorpedoP1.deleteTorpedoWake();
                _prodSupportTorpedoP1.OnSetDestroy();
            }
            _prodSupportTorpedoP1 = null;
            _prodSupportTorpedoP2.Play(_onSupportTorpedoPhase2Finished);
            return(false);
        }
Пример #25
0
        public virtual UniRx.IObservable <bool> Play(Action onPlayBufferEffect, Action onCalcInitLineRotation, Action onPlayLineAnimation, Action onNextFocusShipAnimation, int nBufferCnt)
        {
            _nBufferCnt      = Mathe.MinMax2(nBufferCnt, 0, 4);
            _clsCameraBezier = new Bezier(Bezier.BezierType.Quadratic, _vStartCameraPivot, _listEndCameraPivot[_nBufferCnt], _vMidCameraPivot, Vector3.zero);
            _clsFleetBezier  = new Bezier(Bezier.BezierType.Quadratic, _vStartFleetPivot, _vEndFleetPivot, _vMidFleetPivot, Vector3.zero);
            BattleField battleField = BattleTaskManager.GetBattleField();

            _traFleetAnchorFriend = battleField.dicFleetAnchor[FleetType.Friend];
            _traFleetAnchorEnemy  = battleField.dicFleetAnchor[FleetType.Enemy];
            _traFleetAnchorEnemy.transform.localScale = Vector3.one * 0.8f;
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(isSplit: false);
            battleCameras.fieldDimCamera.maskAlpha = 0f;
            battleCameras.SwitchMainCamera(FleetType.Enemy);
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[1];

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.eyePosition = _clsCameraBezier.Interpolate(0f);
            battleFieldCamera.pointOfGaze = Vector3.Lerp(_clsFleetBezier.Interpolate(0f), _listEnemyFleetPivot[_nBufferCnt], 0.5f);
            battleFieldCamera.transform.LookAt(battleFieldCamera.pointOfGaze);
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetBollboardTarget(battleFieldCamera.transform);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            _actOnPlayBufferEffect       = onPlayBufferEffect;
            _actOnNextFocusShipAnimation = onNextFocusShipAnimation;
            Observable.NextFrame().Subscribe(delegate
            {
                Dlg.Call(ref onCalcInitLineRotation);
                Dlg.Call(ref onPlayLineAnimation);
            });
            return(Observable.FromCoroutine((UniRx.IObserver <bool> observer) => AnimationObserver(observer)));
        }
Пример #26
0
        public virtual IObservable <bool> Play(Action onPlayBufferEffect, Action onCalcInitLineRotation, Action onPlayLineAnimation, Action onNextFocusShipAnimation, int nBufferCnt)
        {
            this._nBufferCnt      = Mathe.MinMax2(nBufferCnt, 0, 4);
            this._clsCameraBezier = new Bezier(Bezier.BezierType.Quadratic, this._vStartCameraPivot, this._listEndCameraPivot.get_Item(this._nBufferCnt), this._vMidCameraPivot, Vector3.get_zero());
            this._clsFleetBezier  = new Bezier(Bezier.BezierType.Quadratic, this._vStartFleetPivot, this._vEndFleetPivot, this._vMidFleetPivot, Vector3.get_zero());
            BattleField battleField = BattleTaskManager.GetBattleField();

            this._traFleetAnchorFriend = battleField.dicFleetAnchor.get_Item(FleetType.Friend);
            this._traFleetAnchorEnemy  = battleField.dicFleetAnchor.get_Item(FleetType.Enemy);
            this._traFleetAnchorEnemy.get_transform().set_localScale(Vector3.get_one() * 0.8f);
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(false);
            battleCameras.fieldDimCamera.maskAlpha = 0f;
            battleCameras.SwitchMainCamera(FleetType.Enemy);
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(1);

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.eyePosition = this._clsCameraBezier.Interpolate(0f);
            battleFieldCamera.pointOfGaze = Vector3.Lerp(this._clsFleetBezier.Interpolate(0f), this._listEnemyFleetPivot.get_Item(this._nBufferCnt), 0.5f);
            battleFieldCamera.get_transform().LookAt(battleFieldCamera.pointOfGaze);
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetBollboardTarget(battleFieldCamera.get_transform());
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = cutInEffectCamera.get_transform().FindChild("TorpedoLine/OverlayLine").GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            this._actOnPlayBufferEffect       = onPlayBufferEffect;
            this._actOnNextFocusShipAnimation = onNextFocusShipAnimation;
            Observable.NextFrame(FrameCountType.Update).Subscribe(delegate(Unit x)
            {
                Dlg.Call(ref onCalcInitLineRotation);
                Dlg.Call(ref onPlayLineAnimation);
            });
            return(Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.AnimationObserver(observer)));
        }
Пример #27
0
        private bool InitSearchNFlare(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            battleFieldCamera.flareLayer.enabled = true;
            bool flag  = (_clsNightCombat.GetSearchLightShip(is_friend: true) != null) ? true : false;
            bool flag2 = (_clsNightCombat.GetFlareShip(is_friend: true) != null) ? true : false;

            if (flag || flag2)
            {
                if (_prodNightRadarDeployment != null)
                {
                    _prodNightRadarDeployment.RadarObjectConvergence();
                }
                Mem.DelComponentSafe(ref _prodNightRadarDeployment);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.GetBattleShips().SetStandingPosition(StandingPositionType.OneRow);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
                battleFieldCamera.transform.position = _vCameraOriginPos;
                battleFieldCamera.transform.rotation = Quaternion.identity;
                ShipModel_BattleAll shipModel_BattleAll = (!flag) ? _clsNightCombat.GetFlareShip(is_friend: true) : _clsNightCombat.GetSearchLightShip(is_friend: true);
                if (shipModel_BattleAll != null)
                {
                    BattleField  battleField  = BattleTaskManager.GetBattleField();
                    UIBattleShip uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips[shipModel_BattleAll.Index];
                    Vector3      position     = uIBattleShip.transform.position;
                    float        x            = 0f - position.x;
                    battleField.dicFleetAnchor[FleetType.Friend].transform.AddPosX(x);
                    battleFieldCamera.transform.AddPosX(x);
                }
            }
            SearchLight_FlareBullet_PlayAnimation().Subscribe(delegate
            {
                OnSearchNFlareFinished();
            });
            return(false);
        }
Пример #28
0
        private bool InitSearchNFlare(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            battleFieldCamera.flareLayer.set_enabled(true);
            bool searchLightShip = this._clsNightCombat.GetSearchLightShip(true) != null;
            bool flareShip       = this._clsNightCombat.GetFlareShip(true) != null;

            if (searchLightShip || flareShip)
            {
                if (this._prodNightRadarDeployment != null)
                {
                    this._prodNightRadarDeployment.RadarObjectConvergence();
                }
                Mem.DelComponentSafe <ProdNightRadarDeployment>(ref this._prodNightRadarDeployment);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.GetBattleShips().SetStandingPosition(StandingPositionType.OneRow);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
                battleFieldCamera.get_transform().set_position(this._vCameraOriginPos);
                battleFieldCamera.get_transform().set_rotation(Quaternion.get_identity());
                ShipModel_BattleAll shipModel_BattleAll = (!searchLightShip) ? this._clsNightCombat.GetFlareShip(true) : this._clsNightCombat.GetSearchLightShip(true);
                if (shipModel_BattleAll != null)
                {
                    BattleField  battleField  = BattleTaskManager.GetBattleField();
                    UIBattleShip uIBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Item(shipModel_BattleAll.Index);
                    float        x            = -uIBattleShip.get_transform().get_position().x;
                    battleField.dicFleetAnchor.get_Item(FleetType.Friend).get_transform().AddPosX(x);
                    battleFieldCamera.get_transform().AddPosX(x);
                }
            }
            this.SearchLight_FlareBullet_PlayAnimation().Subscribe(delegate(int _)
            {
                this.OnSearchNFlareFinished();
            });
            return(false);
        }
Пример #29
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            _prodAerialCombatP2.gameObject.SetActive(true);
            cutInCamera.cullingMask              = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask        = Generics.Layers.CutIn;
            cutInCamera.depth                    = 5f;
            cutInEffectCamera.depth              = 4f;
            cutInEffectCamera.glowEffect.enabled = true;
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(isSplit: false);
            SlotitemModel_Battle touchPlane  = _clsKoukuu.GetTouchPlane(is_friend: true);
            SlotitemModel_Battle touchPlane2 = _clsKoukuu.GetTouchPlane(is_friend: false);

            _prodAerialTouchPlane.SetActive(isActive: true);
            _prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            _prodAerialCombatP2.Play(_onAircraftCombatFinished, dicFriendBattleShips, dicEnemyBattleShips);
            Object.Destroy(_prodAerialCombatP1.gameObject);
            return(false);
        }
Пример #30
0
        private bool InitMoveCameraTo2D(object data)
        {
            BattleFieldCamera       cam                  = BattleTaskManager.GetBattleCameras().fieldCameras[0];
            BattleShips             battleShips          = BattleTaskManager.GetBattleShips();
            ProdDetectionStartCutIn pdsc                 = ProdDetectionStartCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdDetectionStartCutIn).GetComponent <ProdDetectionStartCutIn>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform);
            ShipModel_Battle        detectionPrimaryShip = ShipUtils.GetDetectionPrimaryShip(_clsSakuteki.planes_f, isFriend: true);
            UIBattleShip            uIBattleShip         = (detectionPrimaryShip == null) ? battleShips.flagShipFriend : battleShips.dicFriendBattleShips[detectionPrimaryShip.Index];
            Vector3 vector           = Mathe.NormalizeDirection(uIBattleShip.pointOfGaze, Vector3.zero) * 30f;
            Vector3 pointOfGaze      = uIBattleShip.pointOfGaze;
            float   x                = pointOfGaze.x;
            Vector3 pointOfGaze2     = uIBattleShip.pointOfGaze;
            float   y                = pointOfGaze2.y;
            Vector3 pointOfGaze3     = uIBattleShip.pointOfGaze;
            Vector3 fixChasingCamera = new Vector3(x, y, pointOfGaze3.z + vector.z);

            cam.pointOfGaze = uIBattleShip.pointOfGaze;
            cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
            cam.SetFixChasingCamera(fixChasingCamera);
            Vector3   pointOfGaze4 = uIBattleShip.pointOfGaze;
            float     x2           = pointOfGaze4.x;
            Vector3   pointOfGaze5 = uIBattleShip.pointOfGaze;
            Vector3   endCamPos    = new Vector3(x2, 50f, pointOfGaze5.z + vector.z * 6f);
            Transform transform    = uIBattleShip.transform;
            Vector3   position     = BattleTaskManager.GetBattleShips().dicFriendBattleShips[0].transform.position;

            _psDetectionRipple = Util.Instantiate(ParticleFile.Load(ParticleFileInfos.BattlePSDetectionRipple)).GetComponent <ParticleSystem>();
            ((Component)_psDetectionRipple).transform.parent   = transform;
            ((Component)_psDetectionRipple).transform.position = new Vector3(position.x, position.y + 0.01f, position.z);
            _psDetectionRipple.Play();
            pdsc.Play().Subscribe(delegate
            {
                cam.transform.LTMove(endCamPos, 1.95f).setEase(LeanTweenType.easeInOutCubic);
                Mem.DelComponentSafe(ref pdsc);
            });
            return(false);
        }