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);
        }
Пример #3
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);
        }
Пример #4
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);
        }
Пример #6
0
        protected virtual Vector3 CalcProtecterPos(Vector3 close4)
        {
            BattleField battleField = BattleTaskManager.GetBattleField();
            Vector3     vector      = Vector3.Lerp(this._listBattleShips.get_Item(1).spPointOfGaze, close4, 0.58f);
            Vector3     position    = this._listBattleShips.get_Item(1).get_transform().get_position();

            position.y = battleField.seaLevelPos.y;
            position.z = vector.z;
            return(position);
        }
Пример #7
0
        protected void CorFleetAnchorDifPosition()
        {
            BattleField battleField = BattleTaskManager.GetBattleField();
            Vector3     to          = (!this._listBattleShips.get_Item(0).shipModel.IsFriend()) ? this._listBattleShips.get_Item(1).get_transform().get_position() : this._listBattleShips.get_Item(0).get_transform().get_position();
            Vector3     to2         = this._listBattleShips.get_Item(0).shipModel.IsFriend() ? this._listBattleShips.get_Item(1).get_transform().get_position() : this._listBattleShips.get_Item(0).get_transform().get_position();
            Vector3     vector      = Mathe.Direction(Vector3.get_zero(), to);
            Vector3     vector2     = Mathe.Direction(Vector3.get_zero(), to2);

            battleField.dicFleetAnchor.get_Item(FleetType.Friend).get_transform().AddPosX(-vector.x);
            battleField.dicFleetAnchor.get_Item(FleetType.Enemy).get_transform().AddPosX(-vector2.x);
        }
        protected void CorFleetAnchorDifPosition()
        {
            BattleField battleField = BattleTaskManager.GetBattleField();
            Vector3     to          = (!_listBattleShips[0].shipModel.IsFriend()) ? _listBattleShips[1].transform.position : _listBattleShips[0].transform.position;
            Vector3     to2         = _listBattleShips[0].shipModel.IsFriend() ? _listBattleShips[1].transform.position : _listBattleShips[0].transform.position;
            Vector3     vector      = Mathe.Direction(Vector3.zero, to);
            Vector3     vector2     = Mathe.Direction(Vector3.zero, to2);

            battleField.dicFleetAnchor[FleetType.Friend].transform.AddPosX(0f - vector.x);
            battleField.dicFleetAnchor[FleetType.Enemy].transform.AddPosX(0f - vector2.x);
        }
        protected virtual Vector3 CalcProtecterPos(Vector3 close4)
        {
            BattleField battleField = BattleTaskManager.GetBattleField();
            Vector3     vector      = Vector3.Lerp(_listBattleShips[1].spPointOfGaze, close4, 0.58f);
            Vector3     position    = _listBattleShips[1].transform.position;
            Vector3     seaLevelPos = battleField.seaLevelPos;

            position.y = seaLevelPos.y;
            position.z = vector.z;
            return(position);
        }
 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);
 }
Пример #11
0
        private bool InitNightMessage(object data)
        {
            _prodNightRadarDeployment = ProdNightRadarDeployment.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdNightRadarDeployment).GetComponent <ProdNightRadarDeployment>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform);
            _prodNightRadarDeployment.Play().Subscribe(delegate
            {
                OnNightMessageFinished();
            });
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.isEnemySeaLevelActive = false;
            ShipModel_Battle model = BattleTaskManager.GetBattleManager().Ships_f[0];

            KCV.Battle.Utils.ShipUtils.PlayStartNightCombatVoice(model);
            return(false);
        }
        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);
        }
Пример #14
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);
        }
Пример #15
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);
        }
Пример #16
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)));
        }
Пример #17
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)));
        }
Пример #18
0
        private void MakeRadar()
        {
            BattleField     field      = BattleTaskManager.GetBattleField();
            BattlePefabFile prefabFile = BattleTaskManager.GetPrefabFile();
            Transform       p          = prefabFile.prefabUIBufferFleetCircle;

            _listBufferFleetCircle = new List <UIBufferFleetCircle>();
            foreach (int value in Enum.GetValues(typeof(FleetType)))
            {
                if (value != 2)
                {
                    _listBufferFleetCircle.Add(UIBufferFleetCircle.Instantiate(((Component)p).GetComponent <UIBufferFleetCircle>(), field.dicFleetAnchor[(FleetType)value], (FleetType)value));
                    _listBufferFleetCircle[value].transform.positionY(0.001f);
                }
            }
            Mem.Del(ref p);
            Transform prefab = prefabFile.prefabUIBufferShipCircle;

            _dicBufferShipCircle = new Dictionary <int, List <UIBufferCircle> >();
            int cnt = 0;
            List <UIBufferCircle> friendBufferCircle = new List <UIBufferCircle>();

            dicFriendBattleShips.ForEach(delegate(KeyValuePair <int, UIBattleShip> x)
            {
                friendBufferCircle.Add(UIBufferCircle.Instantiate(((Component)prefab).GetComponent <UIBufferCircle>(), x.Value.transform, FleetType.Friend, field.dicFleetAnchor[FleetType.Enemy]));
                cnt++;
            });
            _dicBufferShipCircle.Add(0, friendBufferCircle);
            cnt = 0;
            List <UIBufferCircle> enemyBufferCircle = new List <UIBufferCircle>();

            _dicEnemyBattleShips.ForEach(delegate(KeyValuePair <int, UIBattleShip> x)
            {
                enemyBufferCircle.Add(UIBufferCircle.Instantiate(((Component)prefab).GetComponent <UIBufferCircle>(), x.Value.transform, FleetType.Enemy, field.dicFleetAnchor[FleetType.Friend]));
                cnt++;
            });
            _dicBufferShipCircle.Add(1, enemyBufferCircle);
            Mem.Del(ref prefab);
            _isMakeRadar = true;
        }
Пример #19
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);
        }
Пример #20
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 static ParticleSystem InstantiateParticle(ref ParticleSystem system, ref Transform prefab)
 {
     return(BattleParticleFile.InstantiateParticle(ref system, ref prefab, BattleTaskManager.GetBattleField().get_transform()));
 }