Пример #1
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);
        }
 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);
 }
Пример #4
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)));
        }
Пример #5
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)));
        }