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);
        }
Пример #2
0
        protected virtual bool InitRotateFocus(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            battleFieldCamera.motionBlur.set_enabled(false);
            this.GraSubDimCameraMaskAlpha(BattleDefines.SHELLING_ATTACK_ATTACKER_CLOSEUP_TIME.get_Item(0));
            this.RotateFocusTowardsTarget2RotateFieldCam(this._listBattleShips.get_Item(1).spPointOfGaze);
            this.RotateFocusTowardTarget2MoveFieldCam(this._listBattleShips.get_Item(1).spPointOfGaze, delegate
            {
                this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitDefenderFocus), new StatementMachine.StatementMachineUpdate(this.UpdateDefenderFocus));
            });
            return(false);
        }
Пример #3
0
 protected virtual void RotateFocusTowardsTarget2RotateFieldCam(Vector3 target)
 {
     Observable.Timer(TimeSpan.FromSeconds(0.30000001192092896)).Subscribe(delegate(long _)
     {
         BattleFieldCamera cam = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
         float num             = (!this._listBattleShips.get_Item(0).shipModel.IsFriend()) ? -180f : 180f;
         Vector3 vector        = new Vector3(cam.eyeRotation.x, num, cam.eyeRotation.z);
         cam.get_transform().LTRotateAround(Vector3.get_up(), num, 0.666f).setEase(LeanTweenType.easeInQuad).setOnComplete(delegate
         {
             cam.LookAt(target);
             cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
         });
     });
 }
        protected virtual bool InitRotateFocus(object data)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            battleFieldCamera.motionBlur.enabled = false;
            GraSubDimCameraMaskAlpha(BattleDefines.SHELLING_ATTACK_ATTACKER_CLOSEUP_TIME[0]);
            RotateFocusTowardsTarget2RotateFieldCam(_listBattleShips[1].spPointOfGaze);
            RotateFocusTowardTarget2MoveFieldCam(_listBattleShips[1].spPointOfGaze, delegate
            {
                _clsState.AddState(InitDefenderFocus, UpdateDefenderFocus);
            });
            return(false);
        }
Пример #5
0
        private bool UpdateMoveCameraTo2D(object data)
        {
            ProdCloud prodCloud = BattleTaskManager.GetPrefabFile().prodCloud;

            if (!prodCloud.isPlaying)
            {
                BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[0];
                Vector3           eyePosition       = battleFieldCamera.eyePosition;
                float             y      = eyePosition.y;
                Vector3           vector = Vector3.Lerp(Vector3.zero, Vector3.up * 50f, 0.15f);
                if (y >= vector.y)
                {
                    prodCloud.Play(ProdCloud.AnimationList.ProdCloudOut, delegate
                    {
                        if (_prodDetectionCutIn.isAircraft)
                        {
                            _prodDetectionCutIn.Play(delegate
                            {
                                if (_iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces || _iResult == ProdDetectionResultCutIn.AnimationList.DetectionLost)
                                {
                                    _clsState.AddState(InitDetectionResultCutIn, UpdateDetectionResultCutIn);
                                }
                                else
                                {
                                    _clsState.AddState(InitEnemyFleetFocus, UpdateEnemyFleetFocus);
                                }
                            }, null);
                        }
                        else if (_iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces)
                        {
                            _clsState.AddState(InitDetectionResultCutIn, UpdateDetectionResultCutIn);
                        }
                        else
                        {
                            _clsState.AddState(InitEnemyFleetFocus, UpdateEnemyFleetFocus);
                            InitCameraSettingsForEnemyFocus();
                        }
                    }, delegate
                    {
                        if (_prodDetectionCutIn.isAircraft || (!_prodDetectionCutIn.isAircraft && _iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces))
                        {
                            InitCameraSettingsForEnemyFocus();
                        }
                    });
                    return(true);
                }
            }
            return(false);
        }
        private bool UpdateMoveCameraTo2D(object data)
        {
            ProdCloud prodCloud = BattleTaskManager.GetPrefabFile().prodCloud;

            if (!prodCloud.isPlaying)
            {
                BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);
                if (battleFieldCamera.eyePosition.y >= Vector3.Lerp(Vector3.get_zero(), Vector3.get_up() * 50f, 0.15f).y)
                {
                    prodCloud.Play(ProdCloud.AnimationList.ProdCloudOut, delegate
                    {
                        if (this._prodDetectionCutIn.isAircraft)
                        {
                            this._prodDetectionCutIn.Play(delegate
                            {
                                if (this._iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces || this._iResult == ProdDetectionResultCutIn.AnimationList.DetectionLost)
                                {
                                    this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitDetectionResultCutIn), new StatementMachine.StatementMachineUpdate(this.UpdateDetectionResultCutIn));
                                }
                                else
                                {
                                    this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitEnemyFleetFocus), new StatementMachine.StatementMachineUpdate(this.UpdateEnemyFleetFocus));
                                }
                            }, null);
                        }
                        else if (this._iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces)
                        {
                            this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitDetectionResultCutIn), new StatementMachine.StatementMachineUpdate(this.UpdateDetectionResultCutIn));
                        }
                        else
                        {
                            this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitEnemyFleetFocus), new StatementMachine.StatementMachineUpdate(this.UpdateEnemyFleetFocus));
                            this.InitCameraSettingsForEnemyFocus();
                        }
                    }, delegate
                    {
                        if (this._prodDetectionCutIn.isAircraft || (!this._prodDetectionCutIn.isAircraft && this._iResult == ProdDetectionResultCutIn.AnimationList.DetectionSucces))
                        {
                            this.InitCameraSettingsForEnemyFocus();
                        }
                    });
                    return(true);
                }
            }
            return(false);
        }
 protected virtual void RotateFocusTowardsTarget2RotateFieldCam(Vector3 target)
 {
     Observable.Timer(TimeSpan.FromSeconds(0.30000001192092896)).Subscribe(delegate
     {
         BattleFieldCamera cam  = BattleTaskManager.GetBattleCameras().fieldCameras[0];
         float num              = (!_listBattleShips[0].shipModel.IsFriend()) ? (-180f) : 180f;
         Quaternion eyeRotation = cam.eyeRotation;
         float x = eyeRotation.x;
         float y = num;
         Quaternion eyeRotation2 = cam.eyeRotation;
         Vector3 vector          = new Vector3(x, y, eyeRotation2.z);
         cam.transform.LTRotateAround(Vector3.up, num, 0.666f).setEase(LeanTweenType.easeInQuad).setOnComplete((Action) delegate
         {
             cam.LookAt(target);
             cam.ReqViewMode(CameraActor.ViewMode.FixChasing);
         });
     });
 }
Пример #8
0
 protected virtual void LateUpdate()
 {
     if (animation.isPlaying)
     {
         _vCameraPos = _clsCameraBezier.Interpolate(_fProgress);
         _vFleetPos  = _clsFleetBezier.Interpolate(_fProgress);
         if (Application.isPlaying)
         {
             BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[1];
             battleFieldCamera.transform.position = _vCameraPos;
             battleFieldCamera.fieldOfView        = _fFov;
             _vCameraPog = Vector3.Lerp(_vFleetPos, _listEnemyFleetPivot[_nBufferCnt], 0.5f);
             battleFieldCamera.pointOfGaze  = _vCameraPog;
             _traFleetAnchorFriend.position = _vFleetPos;
             _traFleetAnchorEnemy.position  = _listEnemyFleetPivot[_nBufferCnt];
             _traFleetAnchorFriend.rotation = Quaternion.Euler(new Vector3(0f, _fFleetRotation, 0f));
         }
     }
 }
Пример #9
0
 protected virtual void LateUpdate()
 {
     if (this.animation.get_isPlaying())
     {
         this._vCameraPos = this._clsCameraBezier.Interpolate(this._fProgress);
         this._vFleetPos  = this._clsFleetBezier.Interpolate(this._fProgress);
         if (Application.get_isPlaying())
         {
             BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(1);
             battleFieldCamera.get_transform().set_position(this._vCameraPos);
             battleFieldCamera.fieldOfView = this._fFov;
             this._vCameraPog = Vector3.Lerp(this._vFleetPos, this._listEnemyFleetPivot.get_Item(this._nBufferCnt), 0.5f);
             battleFieldCamera.pointOfGaze = this._vCameraPog;
             this._traFleetAnchorFriend.set_position(this._vFleetPos);
             this._traFleetAnchorEnemy.set_position(this._listEnemyFleetPivot.get_Item(this._nBufferCnt));
             this._traFleetAnchorFriend.set_rotation(Quaternion.Euler(new Vector3(0f, this._fFleetRotation, 0f)));
         }
     }
 }
Пример #10
0
        protected virtual void PlayProtectDefender(List <Vector3> camTargetPos)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera fieldCam      = battleCameras.fieldCameras.get_Item(0);

            fieldCam.get_transform().LTMove(camTargetPos.get_Item(1), BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(1)).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE.get_Item(1));
            Observable.Timer(TimeSpan.FromSeconds(0.42500001192092896)).Subscribe(delegate(long _)
            {
                fieldCam.get_transform().LTCancel();
                this.SetProtecterLayer();
                Vector3 to = this.CalcProtecterPos(camTargetPos.get_Item(3));
                this._listBattleShips.get_Item(2).get_transform().positionZ(to.z);
                this._listBattleShips.get_Item(2).get_transform().LTMove(to, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(0) * 1.2f).setEase(LeanTweenType.easeOutSine);
                fieldCam.get_transform().LTMove(camTargetPos.get_Item(2), BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(0)).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE.get_Item(0)).setOnComplete(delegate
                {
                    this.PlayDefenderEffect(this._listBattleShips.get_Item(2), this._listBattleShips.get_Item(2).pointOfGaze, fieldCam, 0.5f);
                    this.ChkDamagedStateFmAnticipating(camTargetPos.get_Item(3));
                });
            });
        }
        protected virtual void PlayProtectDefender(List <Vector3> camTargetPos)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera fieldCam      = battleCameras.fieldCameras[0];

            fieldCam.transform.LTMove(camTargetPos[1], BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[1]).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE[1]);
            Observable.Timer(TimeSpan.FromSeconds(0.42500001192092896)).Subscribe(delegate
            {
                fieldCam.transform.LTCancel();
                SetProtecterLayer();
                Vector3 to = CalcProtecterPos(camTargetPos[3]);
                _listBattleShips[2].transform.positionZ(to.z);
                _listBattleShips[2].transform.LTMove(to, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[0] * 1.2f).setEase(LeanTweenType.easeOutSine);
                fieldCam.transform.LTMove(camTargetPos[2], BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[0]).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE[0]).setOnComplete((Action) delegate
                {
                    PlayDefenderEffect(_listBattleShips[2], _listBattleShips[2].pointOfGaze, fieldCam, 0.5f);
                    ChkDamagedStateFmAnticipating(camTargetPos[3]);
                });
            });
        }
Пример #12
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)));
        }
Пример #13
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)));
        }
Пример #14
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);
        }
Пример #15
0
        protected virtual void SetFieldCamera(bool isAttacker, Vector3 camPos, Vector3 lookPos)
        {
            BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0);

            if (isAttacker)
            {
                battleFieldCamera.motionBlur.set_enabled(false);
                battleFieldCamera.motionBlur.blurAmount = 0.65f;
                battleFieldCamera.get_transform().set_position(camPos);
                battleFieldCamera.LookAt(lookPos);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
                battleFieldCamera.cullingMask = (Generics.Layers.FocusDim | Generics.Layers.UnRefrectEffects);
                battleFieldCamera.clearFlags  = 3;
            }
            else
            {
                battleFieldCamera.motionBlur.set_enabled(false);
                battleFieldCamera.get_transform().set_position(camPos);
                battleFieldCamera.LookAt(lookPos);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            }
        }
        protected virtual void SetFieldCamera(bool isAttacker, Vector3 camPos, Vector3 lookPos)
        {
            BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[0];

            if (isAttacker)
            {
                battleFieldCamera.motionBlur.enabled    = false;
                battleFieldCamera.motionBlur.blurAmount = 0.65f;
                battleFieldCamera.transform.position    = camPos;
                battleFieldCamera.LookAt(lookPos);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
                battleFieldCamera.cullingMask = (Generics.Layers.FocusDim | Generics.Layers.UnRefrectEffects);
                battleFieldCamera.clearFlags  = CameraClearFlags.Depth;
            }
            else
            {
                battleFieldCamera.motionBlur.enabled = false;
                battleFieldCamera.transform.position = camPos;
                battleFieldCamera.LookAt(lookPos);
                battleFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            }
        }
Пример #17
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);
        }
 public BattleCameras()
 {
     this._camCutInCamera                   = GameObject.Find("UIRoot/CutInCamera").GetComponent <BattleCutInCamera>();
     this._camCutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
     this._camCutInCamera.depth             = 6f;
     this._camCutInCamera.clearFlags        = 3;
     this._camCutInEffectCamera             = GameObject.Find("UIRoot/CutInEffectCamera").GetComponent <BattleCutInEffectCamera>();
     this._camCutInEffectCamera.cullingMask = Generics.Layers.CutIn;
     this._camCutInEffectCamera.isCulling   = false;
     this._camCutInEffectCamera.depth       = 5f;
     this._camCutInEffectCamera.clearFlags  = 3;
     this._listCameras = new List <BattleFieldCamera>();
     using (IEnumerator enumerator = Enum.GetValues(typeof(FleetType)).GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             FleetType fleetType = (FleetType)((int)enumerator.get_Current());
             if (fleetType != FleetType.CombinedFleet)
             {
                 BattleFieldCamera battleFieldCamera = (!GameObject.Find(string.Format("Stage/{0}FieldCamera", fleetType))) ? null : GameObject.Find(string.Format("Stage/{0}FieldCamera", fleetType)).GetComponent <BattleFieldCamera>();
                 this._listCameras.Add(battleFieldCamera);
                 if (this._listCameras.get_Item((int)fleetType) != null)
                 {
                     this._listCameras.get_Item((int)fleetType).cullingMask = this.GetDefaultLayers();
                     this._listCameras.get_Item((int)fleetType).ResetMotionBlur();
                     this._listCameras.get_Item((int)fleetType).depth = 0f;
                 }
             }
         }
     }
     this._camFieldDimCamera             = BattleFieldDimCamera.Instantiate(BattleTaskManager.GetPrefabFile().prefabFieldDimCamera.GetComponent <BattleFieldDimCamera>(), BattleTaskManager.GetStage());
     this._camFieldDimCamera.syncTarget  = this._listCameras.get_Item(0).get_transform();
     this._camFieldDimCamera.cullingMask = this.GetDefaultDimLayers();
     this._camFieldDimCamera.isCulling   = false;
     this._camFieldDimCamera.depth       = -1f;
 }
Пример #19
0
        protected void PlayDefenderEffect(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera, float delay)
        {
            Observable.Timer(TimeSpan.FromSeconds((double)delay)).Subscribe(delegate(long _)
            {
                switch (this.hitState)
                {
                case HitState.Miss:
                    this.PlayDefenderMiss(ship, defenderPos, fieldCamera);
                    break;

                case HitState.Gard:
                    this.PlayDefenderGard(ship, defenderPos, fieldCamera);
                    break;

                case HitState.NomalDamage:
                    this.PlayDefenderNormal(ship, defenderPos, fieldCamera);
                    break;

                case HitState.CriticalDamage:
                    this.PlayDefenderCritical(ship, defenderPos, fieldCamera);
                    break;
                }
            });
        }
Пример #20
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);
        }
        protected virtual void PlayDefenderMiss(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            SoundUtils.PlayDamageSE(HitState.Miss, isTorpedo: false);
            ParticleSystem splashMiss = BattleTaskManager.GetParticleFile().splashMiss;

            ((Component)splashMiss).transform.parent = particleParent;
            ((Component)splashMiss).SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), includeChildren: true);
            ((Component)splashMiss).transform.position = Vector3.Lerp(fieldCamera.transform.position, defenderPos, 1f);
            ((Component)splashMiss).transform.positionY();
            Transform transform      = ((Component)splashMiss).transform;
            Vector3   localPosition  = ((Component)splashMiss).transform.localPosition;
            float     x              = localPosition.x;
            Vector3   localPosition2 = ((Component)splashMiss).transform.localPosition;

            transform.localPosition = new Vector3(x, localPosition2.y, (!ship.shipModel.IsFriend()) ? (-15f) : 15f);
            ((Component)splashMiss).SetActive(isActive: true);
            splashMiss.Play();
            PlayHpGaugeDamage(ship, hitState);
        }
Пример #22
0
        protected virtual void PlayDefenderMiss(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            SoundUtils.PlayDamageSE(HitState.Miss, false);
            ParticleSystem splashMiss = BattleTaskManager.GetParticleFile().splashMiss;

            splashMiss.get_transform().set_parent(this.particleParent);
            splashMiss.SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), true);
            splashMiss.get_transform().set_position(Vector3.Lerp(fieldCamera.get_transform().get_position(), defenderPos, 1f));
            splashMiss.get_transform().positionY(0f);
            splashMiss.get_transform().set_localPosition(new Vector3(splashMiss.get_transform().get_localPosition().x, splashMiss.get_transform().get_localPosition().y, (!ship.shipModel.IsFriend()) ? -15f : 15f));
            splashMiss.SetActive(true);
            splashMiss.Play();
            this.PlayHpGaugeDamage(ship, this.hitState);
        }
        protected virtual void PlayDefenderGard(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            ParticleSystem explosionB3WhiteSmoke = BattleTaskManager.GetParticleFile().explosionB3WhiteSmoke;

            ((Component)explosionB3WhiteSmoke).transform.parent = particleParent;
            ((Component)explosionB3WhiteSmoke).SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), includeChildren: true);
            ((Component)explosionB3WhiteSmoke).transform.position = Vector3.Lerp(fieldCamera.transform.position, defenderPos, 0.9f);
            ((Component)explosionB3WhiteSmoke).SetActive(isActive: true);
            explosionB3WhiteSmoke.Play();
            SoundUtils.PlayDamageSE(HitState.Gard, isTorpedo: false);
            PlayDamageVoice(ship, _clsHougekiModel.Defender.DamageEventAfter);
            PlayHpGaugeDamage(ship, hitState);
            fieldCamera.cameraShake.ShakeRot(null);
        }
Пример #24
0
        protected virtual void PlayDefenderGard(UIBattleShip ship, Vector3 defenderPos, BattleFieldCamera fieldCamera)
        {
            ParticleSystem explosionB3WhiteSmoke = BattleTaskManager.GetParticleFile().explosionB3WhiteSmoke;

            explosionB3WhiteSmoke.get_transform().set_parent(this.particleParent);
            explosionB3WhiteSmoke.SetLayer(Generics.Layers.UnRefrectEffects.IntLayer(), true);
            explosionB3WhiteSmoke.get_transform().set_position(Vector3.Lerp(fieldCamera.get_transform().get_position(), defenderPos, 0.9f));
            explosionB3WhiteSmoke.SetActive(true);
            explosionB3WhiteSmoke.Play();
            SoundUtils.PlayDamageSE(HitState.Gard, false);
            this.PlayDamageVoice(ship, this._clsHougekiModel.Defender.DamageEventAfter);
            this.PlayHpGaugeDamage(ship, this.hitState);
            fieldCamera.cameraShake.ShakeRot(null);
        }
Пример #25
0
        private IEnumerator CreateBattleShips(ShipModel_BattleAll[] ships, BattleFormationKinds1 iKind, GameObject parent, Dictionary <int, UIBattleShip> dic, FleetType iType, int fleetNum, int combineNum)
        {
            BattleFieldCamera cam = BattleTaskManager.GetBattleCameras().fieldCameras[0];

            Vector3[] formationPos = BattleDefines.FORMATION_POSITION[iKind][fleetNum];
            Vector3[] oneRowPos    = BattleDefines.FORMATION_POSITION[BattleFormationKinds1.TanOu][fleetNum];
            int       index        = 0;

            foreach (ShipModel_BattleAll model in ships)
            {
                if (model == null)
                {
                    continue;
                }
                UIBattleShip ship;
                if (_traFriendFleetAnchor.transform.FindChild(string.Format("{1}FleetAnchor/BattleShip{0}", index + 1, iType)) != null)
                {
                    ship = ((Component)_traFriendFleetAnchor.transform.FindChild(string.Format("{1}FleetAnchor/BattleShip{0}", index + 1, iType))).GetComponent <UIBattleShip>();
                }
                else
                {
                    ship      = UIBattleShip.Instantiate(_uiOriginalShip.GetComponent <UIBattleShip>(), parent.transform);
                    ship.name = $"BattleShip{model.Index}";
                    Vector3 pos;
                    Vector3 lPos;
                    Vector3 commandBufferPos;
                    Vector3 advancePos;
                    if (index < formationPos.Length)
                    {
                        pos              = ((iType != 0) ? (-formationPos[index] * 1f) : (formationPos[index] * 1f));
                        lPos             = oneRowPos[index] * 1f;
                        commandBufferPos = ((iType != 0) ? (-formationPos[index] * 4f) : (formationPos[index] * 4f));
                        advancePos       = ((iType != 0) ? (lPos + Vector3.forward * 5f) : (lPos + Vector3.back * 5f));
                    }
                    else
                    {
                        pos              = Vector3.zero;
                        lPos             = Vector3.zero;
                        commandBufferPos = Vector3.zero;
                        advancePos       = Vector3.zero;
                    }
                    ship.transform.localPosition = lPos;
                    ship.dicStandingPos[StandingPositionType.Formation]     = pos;
                    ship.dicStandingPos[StandingPositionType.OneRow]        = lPos;
                    ship.dicStandingPos[StandingPositionType.CommandBuffer] = commandBufferPos;
                    ship.dicStandingPos[StandingPositionType.Advance]       = advancePos;
                    ship.billboard.billboardTarget          = cam.transform;
                    ship.billboard.isBillboard              = true;
                    ship.billboard.isEnableVerticalRotation = false;
                    ship.drawType = ShipDrawType.Normal;
                }
                dic.Add(index, ship);
                dic[index].SetShipInfos(model, isStart: true);
                if (model.IsEscape())
                {
                    dic[index].SetActive(isActive: false);
                }
                index++;
                yield return(null);
            }
            yield return(null);
        }
Пример #26
0
        protected virtual void ChkDamagedStateFmAnticipating(Vector3 closeUpPos)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            switch (this._clsHougekiModel.Defender.DamageEventAfter)
            {
            case DamagedStates.None:
            case DamagedStates.Shouha:
                battleFieldCamera.get_transform().LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(1)).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE.get_Item(1)).setOnComplete(delegate
                {
                    this.OnFinished();
                });
                break;

            case DamagedStates.Tyuuha:
            case DamagedStates.Taiha:
                battleFieldCamera.get_transform().LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(1)).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE.get_Item(1)).setOnComplete(delegate
                {
                    ShellingProdSubject shellingProdSubject2 = (!this.isProtect) ? ShellingProdSubject.Defender : ShellingProdSubject.Protector;
                    if (this._listBattleShips.get_Item((int)shellingProdSubject2).shipModel.IsFriend())
                    {
                        DamagedStates damageEventAfter        = this._clsHougekiModel.Defender.DamageEventAfter;
                        ProdDamageCutIn.DamageCutInType iType = (damageEventAfter != DamagedStates.Taiha) ? ProdDamageCutIn.DamageCutInType.Moderate : ProdDamageCutIn.DamageCutInType.Heavy;
                        ProdDamageCutIn prodDamageCutIn       = BattleTaskManager.GetPrefabFile().prodDamageCutIn;
                        ProdDamageCutIn arg_76_0       = prodDamageCutIn;
                        List <ShipModel_Defender> list = new List <ShipModel_Defender>();
                        list.Add(this._clsHougekiModel.Defender);
                        arg_76_0.SetShipData(list, iType);
                        prodDamageCutIn.Play(iType, delegate
                        {
                            BattleTaskManager.GetPrefabFile().circleHPGauge.get_transform().set_localScale(Vector3.get_zero());
                        }, delegate
                        {
                            BattleTaskManager.GetBattleShips().UpdateDamageAll(this._clsHougekiModel);
                            this.OnFinished();
                        });
                    }
                    else
                    {
                        this.OnFinished();
                    }
                });
                break;

            case DamagedStates.Gekichin:
            case DamagedStates.Youin:
            case DamagedStates.Megami:
            {
                bool isFriend = this._listBattleShips.get_Item(1).shipModel.IsFriend();
                ShellingProdSubject shellingProdSubject = (!this.isProtect) ? ShellingProdSubject.Defender : ShellingProdSubject.Protector;
                this._listBattleShips.get_Item((int)shellingProdSubject).PlayProdSinking(null);
                battleFieldCamera.get_transform().LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME.get_Item(2)).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE.get_Item(1)).setOnComplete(delegate
                    {
                        if (!isFriend)
                        {
                            this.OnFinished();
                        }
                    });
                if (isFriend)
                {
                    Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate(long _)
                        {
                            ProdSinking prodSinking = BattleTaskManager.GetPrefabFile().prodSinking;
                            prodSinking.SetSinkingData(this._clsHougekiModel.Defender);
                            prodSinking.Play(delegate
                            {
                                BattleTaskManager.GetPrefabFile().circleHPGauge.get_transform().set_localScale(Vector3.get_zero());
                            }, delegate
                            {
                            }, delegate
                            {
                                this.OnFinished();
                            });
                            BattleTaskManager.GetPrefabFile().circleHPGauge.get_transform().set_localScale(Vector3.get_zero());
                        });
                }
                break;
            }
            }
        }
        protected virtual void ChkDamagedStateFmAnticipating(Vector3 closeUpPos)
        {
            BattleCameras     battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            switch (_clsHougekiModel.Defender.DamageEventAfter)
            {
            case DamagedStates.Gekichin:
            case DamagedStates.Youin:
            case DamagedStates.Megami:
            {
                bool isFriend             = _listBattleShips[1].shipModel.IsFriend();
                ShellingProdSubject index = (!isProtect) ? ShellingProdSubject.Defender : ShellingProdSubject.Protector;
                _listBattleShips[(int)index].PlayProdSinking(null);
                battleFieldCamera.transform.LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[2]).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE[1]).setOnComplete((Action) delegate
                    {
                        if (!isFriend)
                        {
                            OnFinished();
                        }
                    });
                if (isFriend)
                {
                    Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate
                        {
                            ProdSinking prodSinking = BattleTaskManager.GetPrefabFile().prodSinking;
                            prodSinking.SetSinkingData(_clsHougekiModel.Defender);
                            prodSinking.Play(delegate
                            {
                                BattleTaskManager.GetPrefabFile().circleHPGauge.transform.localScale = Vector3.zero;
                            }, delegate
                            {
                            }, delegate
                            {
                                OnFinished();
                            });
                            BattleTaskManager.GetPrefabFile().circleHPGauge.transform.localScale = Vector3.zero;
                        });
                }
                break;
            }

            case DamagedStates.Tyuuha:
            case DamagedStates.Taiha:
                battleFieldCamera.transform.LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[1]).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE[1]).setOnComplete((Action) delegate
                {
                    ShellingProdSubject index2 = (!isProtect) ? ShellingProdSubject.Defender : ShellingProdSubject.Protector;
                    if (_listBattleShips[(int)index2].shipModel.IsFriend())
                    {
                        DamagedStates damageEventAfter        = _clsHougekiModel.Defender.DamageEventAfter;
                        ProdDamageCutIn.DamageCutInType iType = (damageEventAfter == DamagedStates.Taiha) ? ProdDamageCutIn.DamageCutInType.Heavy : ProdDamageCutIn.DamageCutInType.Moderate;
                        ProdDamageCutIn prodDamageCutIn       = BattleTaskManager.GetPrefabFile().prodDamageCutIn;
                        prodDamageCutIn.SetShipData(new List <ShipModel_Defender>
                        {
                            _clsHougekiModel.Defender
                        }, iType);
                        prodDamageCutIn.Play(iType, delegate
                        {
                            BattleTaskManager.GetPrefabFile().circleHPGauge.transform.localScale = Vector3.zero;
                        }, delegate
                        {
                            BattleTaskManager.GetBattleShips().UpdateDamageAll(_clsHougekiModel);
                            OnFinished();
                        });
                    }
                    else
                    {
                        OnFinished();
                    }
                });
                break;

            case DamagedStates.None:
            case DamagedStates.Shouha:
                battleFieldCamera.transform.LTMove(closeUpPos, BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_TIME[1]).setEase(BattleDefines.SHELLING_ATTACK_DEFENDER_CLOSEUP_EASING_TYPE[1]).setOnComplete((Action) delegate
                {
                    OnFinished();
                });
                break;
            }
        }