Пример #1
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

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

            this._prodAerialTouchPlane = ProdAerialTouchPlane.Instantiate(Resources.Load <ProdAerialTouchPlane>("Prefabs/Battle/Production/AerialCombat/ProdAerialTouchPlane"), cutInCamera2.get_transform());
            this._prodAerialTouchPlane.get_transform().set_localPosition(Vector3.get_zero());
            this._prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            this._prodAerialCombatP2.Play(new Action(this._onAircraftCombatFinished), dicFriendBattleShips, dicEnemyBattleShips);
            return(false);
        }
Пример #2
0
 protected override bool Init()
 {
     if (BattleTaskManager.GetBattleManager().IsPractice)
     {
         SingletonMonoBehaviour <FadeCamera> .Instance.isDrawNowLoading = false;
         SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate
         {
             SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType  = AppInformation.LoadType.Ship;
             SingletonMonoBehaviour <AppInformation> .Instance.NextLoadScene = Generics.Scene.Strategy;
             base.ImmediateTermination();
             Application.LoadLevel(Generics.Scene.LoadingScene.ToString());
         });
     }
     else
     {
         BattleTaskManager.GetPrefabFile().battleShutter.ReqMode(BaseShutter.ShutterMode.Close, delegate
         {
             Observable.Timer(TimeSpan.FromSeconds(0.30000001192092896)).Subscribe(delegate(long _)
             {
                 BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
                 cutInEffectCamera.blur.set_enabled(false);
                 this._prodAdvancingWithDrawalSelect = ProdAdvancingWithDrawalSelect.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdAdvancingWithDrawalSelect.GetComponent <ProdAdvancingWithDrawalSelect>(), BattleTaskManager.GetBattleCameras().cutInCamera.get_transform(), BattleTaskManager.GetRootType());
                 this._prodAdvancingWithDrawalSelect.Play(new DelDecideHexButtonEx(this.DecideAdvancinsWithDrawalBtn));
             });
         });
     }
     return(true);
 }
        private bool _initAircraftSecond(object data)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera cutInCamera   = battleCameras.cutInCamera;

            cutInCamera.isCulling = true;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            CutInType cutInType = (_clsKoukuu2.GetCaptainShip(is_friend: true) != null && _clsKoukuu2.GetCaptainShip(is_friend: false) != null) ? CutInType.Both : ((_clsKoukuu2.GetCaptainShip(is_friend: true) == null) ? CutInType.EnemyOnly : CutInType.FriendOnly);

            if (cutInType == CutInType.Both)
            {
                battleCameras.SetSplitCameras2D(isSplit: true);
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else
            {
                if (cutInType == CutInType.FriendOnly)
                {
                    cutInEffectCamera.isCulling = false;
                }
                battleCameras.SetSplitCameras2D(isSplit: false);
            }
            _prodAerialSecondP1.gameObject.SetActive(true);
            _prodAerialSecondP1.Play(_onAerialSecondPhase1Finished);
            return(false);
        }
Пример #4
0
        private bool _initAircraftCombat(object data)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera cutInCamera   = battleCameras.cutInCamera;

            cutInCamera.isCulling = true;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            if (_prodAerialCutinP._cutinPhaseCheck())
            {
                battleCameras.SetSplitCameras2D(isSplit: true);
            }
            if (_prodAerialCutinP._chkCutInType() == CutInType.Both)
            {
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else if (_prodAerialCutinP._chkCutInType() == CutInType.FriendOnly)
            {
                cutInEffectCamera.isCulling = false;
            }
            Object.Destroy(_prodAerialCutinP.gameObject);
            _prodAerialCombatP1.gameObject.SetActive(true);
            _prodAerialCombatP1.Play(_onAerialCombatPhase1Finished);
            return(false);
        }
        protected virtual void setGlowEffects()
        {
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.glowEffect.set_enabled(true);
            cutInEffectCamera.glowEffect.glowTint = Color.get_black();
        }
Пример #6
0
        private IEnumerator CreateAerialCombatCutIn(IObserver <bool> observer)
        {
            BattleCameras           cams         = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera       inCam        = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera efCam        = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            BattleShips             _battleShips = BattleTaskManager.GetBattleShips();

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

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

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

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Пример #7
0
 public BattleCameras()
 {
     _camCutInCamera                   = GameObject.Find("UIRoot/CutInCamera").GetComponent <BattleCutInCamera>();
     _camCutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
     _camCutInCamera.depth             = 6f;
     _camCutInCamera.clearFlags        = CameraClearFlags.Depth;
     _camCutInEffectCamera             = GameObject.Find("UIRoot/CutInEffectCamera").GetComponent <BattleCutInEffectCamera>();
     _camCutInEffectCamera.cullingMask = Generics.Layers.CutIn;
     _camCutInEffectCamera.isCulling   = false;
     _camCutInEffectCamera.depth       = 5f;
     _camCutInEffectCamera.clearFlags  = CameraClearFlags.Depth;
     _listCameras = new List <BattleFieldCamera>();
     foreach (int value in Enum.GetValues(typeof(FleetType)))
     {
         if (value != 2)
         {
             BattleFieldCamera item = (!GameObject.Find($"Stage/{(FleetType)value}FieldCamera")) ? null : GameObject.Find($"Stage/{(FleetType)value}FieldCamera").GetComponent <BattleFieldCamera>();
             _listCameras.Add(item);
             if (_listCameras[value] != null)
             {
                 _listCameras[value].cullingMask = GetDefaultLayers();
                 _listCameras[value].ResetMotionBlur();
                 _listCameras[value].depth = 0f;
             }
         }
     }
     _camFieldDimCamera             = BattleFieldDimCamera.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabFieldDimCamera).GetComponent <BattleFieldDimCamera>(), BattleTaskManager.GetStage());
     _camFieldDimCamera.syncTarget  = _listCameras[0].transform;
     _camFieldDimCamera.cullingMask = GetDefaultDimLayers();
     _camFieldDimCamera.isCulling   = false;
     _camFieldDimCamera.depth       = -1f;
 }
        protected virtual void setGlowEffects()
        {
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.glowEffect.enabled  = true;
            cutInEffectCamera.glowEffect.glowTint = Color.black;
        }
        private IEnumerator CreateTorpedoCutIn(UniRx.IObserver <bool> observer)
        {
            BattleCutInEffectCamera cam = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture centerLine        = ((Component)cam.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (centerLine != null)
            {
                centerLine.alpha = 0f;
            }
            _prodTorpedoCutIn = ProdTorpedoCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdTorpedoCutIn).GetComponent <ProdTorpedoCutIn>(), _clsRaigeki, cam.transform);
            BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers();
            yield return(new WaitForEndOfFrame());

            prefabProdTorpedoStraight = (UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform);
            Transform transP4 = new GameObject().transform;

            transP4.name            = "ProdTorpedoSalvoPhase2";
            _prodTorpedoSalvoPhase2 = new ProdTorpedoSalvoPhase2(transP4, ((Component)prefabProdTorpedoStraight).GetComponent <TorpedoStraightController>());
            _prodTorpedoSalvoPhase2.Initialize(_clsRaigeki, TorpedoParticle, centerLine);
            yield return(new WaitForEndOfFrame());

            Transform transP3 = new GameObject().transform;

            transP3.name            = "ProdTorpedoSalvoPhase3";
            _prodTorpedoSalvoPhase3 = new ProdTorpedoSalvoPhase3(transP3);
            _prodTorpedoSalvoPhase3.Initialize(_clsRaigeki, TorpedoParticle);
            yield return(new WaitForEndOfFrame());

            _prodTorpedoSalvoPhase3.SetHpGauge();
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Пример #10
0
        protected override bool Init()
        {
            BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
            SingletonMonoBehaviour <FadeCamera> .Instance.SetActive(isActive : true);

            SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate
            {
                BattleTaskManager.GetBattleCameras().SetFieldCameraEnabled(isEnabled: false);
                KCV.Utils.SoundUtils.StopFadeBGM(0.25f, null);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.DestroyUnneccessaryObject2Result();
                Observable.FromCoroutine(BattleUtils.ClearMemory).Subscribe(delegate
                {
                    _clsBattleResult = BattleTaskManager.GetBattleManager().GetBattleResult();
                    BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
                    cutInEffectCamera.glowEffect.enabled      = false;
                    cutInEffectCamera.isCulling = true;
                    _prodVeteransReport         = ProdVeteransReport.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdVeteransReport).GetComponent <ProdVeteransReport>(), cutInEffectCamera.transform, _clsBattleResult);
                    _clsState = new StatementMachine();
                    _clsState.AddState(InitProdVeteransReport, UpdateProdVeteransReport);
                });
            });

            return(true);
        }
Пример #11
0
        private void _onTorpedoExplosionFinished()
        {
            BattleCutInEffectCamera efcam         = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UICircleHPGauge         circleHPGauge = BattleTaskManager.GetPrefabFile().circleHPGauge;

            circleHPGauge.transform.localScaleZero();
            PlayProdDamage(_clsRaigeki, delegate
            {
                efcam.isCulling = true;
                Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate
                {
                    ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                    observerAction.Register(delegate
                    {
                        BattleTaskManager.GetTorpedoHpGauges().Hide();
                    });
                    EndPhase(BattleUtils.NextPhase(BattlePhase.OpeningTorpedoSalvo));
                });
            });
            if (_prodTorpedoSalvoPhase3 != null)
            {
                UnityEngine.Object.Destroy(_prodTorpedoSalvoPhase3.transform.gameObject);
            }
            _prodTorpedoSalvoPhase3 = null;
        }
        protected override bool Init()
        {
            BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
            SingletonMonoBehaviour <FadeCamera> .Instance.SetActive(true);

            SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate
            {
                BattleTaskManager.GetBattleCameras().SetFieldCameraEnabled(false);
                KCV.Utils.SoundUtils.StopFadeBGM(0.25f, null);
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Executions();
                BattleTaskManager.DestroyUnneccessaryObject2Result();
                Observable.FromCoroutine(new Func <IEnumerator>(BattleUtils.ClearMemory), false).Subscribe(delegate(Unit _)
                {
                    this._clsBattleResult = BattleTaskManager.GetBattleManager().GetBattleResult();
                    BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
                    cutInEffectCamera.glowEffect.set_enabled(false);
                    cutInEffectCamera.isCulling = true;
                    this._prodVeteransReport    = ProdVeteransReport.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdVeteransReport.GetComponent <ProdVeteransReport>(), cutInEffectCamera.get_transform(), this._clsBattleResult);
                    this._clsState = new StatementMachine();
                    this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitProdVeteransReport), new StatementMachine.StatementMachineUpdate(this.UpdateProdVeteransReport));
                });
            });

            return(true);
        }
Пример #13
0
        private bool _initTorpedoCloseUp(object data)
        {
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            _prodTorpedoSalvoPhase2.Play(_onTorpedoCloseUpFinished);
            return(false);
        }
Пример #14
0
        protected virtual void onUpadteGlowInt(float val)
        {
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.glowEffect.glowTint.r = val;
            cutInEffectCamera.glowEffect.glowTint.g = val;
            cutInEffectCamera.glowEffect.glowTint.b = val;
        }
        private void _onTorpedoCutInNInjectionFinished()
        {
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            CenterLine       = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();
            CenterLine.alpha = 1f;
            _clsState.AddState(_initTorpedoCloseUp, _updateTorpedoCloseUp);
        }
Пример #16
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);
        }
Пример #18
0
        private void _onTorpedoCutInInjectionFinished()
        {
            BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers();
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            CenterLine       = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();
            CenterLine.alpha = 1f;
            cutInEffectCamera.motionBlur.enabled = false;
            _clsState.AddState(_initTorpedoCloseUp, _updateTorpedoCloseUp);
        }
Пример #19
0
        private bool _initSupportTorpedoPhase1(object data)
        {
            SplashPar = ParticleFile.Load <ParticleSystem>(ParticleFileInfos.BattlePSSplashTorpedo);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            Observable.FromCoroutine((IObserver <bool> observer) => CreateTorpedo1(observer)).Subscribe(delegate
            {
                _prodSupportTorpedoP1.Play(_onSupportTorpedoPhase1Finished);
            });
            return(false);
        }
 private bool InitWithdrawalSelection(object data)
 {
     _prodWithdrawalDecisionSelection.Play(delegate
     {
         BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
         ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
         observerAction.Executions();
         BattleField battleField = BattleTaskManager.GetBattleField();
         battleField.ResetFleetAnchorPosition();
         battleField.enemySeaLevel.SetActive(isActive: true);
         battleField.ReqTimeZone(KCV.Battle.Utils.TimeZone.Night, BattleTaskManager.GetSkyType());
         battleField.AlterWaveDirection(FleetType.Friend, FleetType.Friend);
         battleField.AlterWaveDirection(FleetType.Enemy, FleetType.Enemy);
         BattleShips battleShips = BattleTaskManager.GetBattleShips();
         battleShips.RadarDeployment(isDeploy: false);
         battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
         battleShips.SetStandingPosition(StandingPositionType.OneRow);
         battleShips.SetLayer(Generics.Layers.ShipGirl);
         BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();
         battleCameras.InitEnemyFieldCameraDefault();
         battleCameras.SetVerticalSplitCameras(isSplit: false);
         if (!battleCameras.isSplit)
         {
             battleCameras.SetSplitCameras(isSplit: true);
         }
         battleCameras.ResetFieldCamSettings(FleetType.Friend);
         battleCameras.ResetFieldCamSettings(FleetType.Enemy);
         battleCameras.fieldDimCameraEnabled(isEnabled: false);
         BattleFieldCamera battleFieldCamera = BattleTaskManager.GetBattleCameras().fieldCameras[0];
         battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
         battleFieldCamera.SetFixCamera(_dicSplitCameraPos[FleetType.Friend], _dicSplitCameraRot[FleetType.Friend]);
         battleFieldCamera.cullingMask = battleCameras.GetDefaultLayers();
         battleFieldCamera             = BattleTaskManager.GetBattleCameras().fieldCameras[1];
         battleFieldCamera.ReqViewMode(CameraActor.ViewMode.Fix);
         battleFieldCamera.SetFixCamera(_dicSplitCameraPos[FleetType.Enemy], _dicSplitCameraRot[FleetType.Enemy]);
         battleFieldCamera.cullingMask = battleCameras.GetEnemyCamSplitLayers();
         BattleShips battleShips2      = BattleTaskManager.GetBattleShips();
         battleShips2.SetBollboardTarget(isFriend: true, battleCameras.fieldCameras[0].transform);
         battleShips2.SetBollboardTarget(isFriend: false, battleCameras.fieldCameras[1].transform);
         battleShips2.SetTorpedoSalvoWakeAngle(isSet: false);
         BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
         cutInEffectCamera.isCulling = false;
         UITexture component         = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();
         if (component != null)
         {
             component.alpha = 0f;
         }
         BattleTaskManager.GetTorpedoHpGauges().SetDestroy();
     }, OnDecideWithdrawalButton);
     return(false);
 }
Пример #21
0
        private bool _initSupportAerialPhase2(object data)
        {
            BattleCutInCamera              cutInCamera         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2        = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera   = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShip = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShip  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            Object.Destroy(_prodSupportAerialPhase1.gameObject);
            cutInCamera.cullingMask              = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask        = Generics.Layers.CutIn;
            cutInCamera.depth                    = 5f;
            cutInEffectCamera.depth              = 4f;
            cutInEffectCamera.glowEffect.enabled = true;
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(isSplit: false);
            _prodSupportAerialPhase2.Play(_onSupportAerialFinishedPhase2);
            return(false);
        }
Пример #22
0
        private bool _initAircraftSecondPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

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

            cutInCamera.isCulling = true;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            CutInType cutInType;

            if (this._clsKoukuu2.GetCaptainShip(true) != null && this._clsKoukuu2.GetCaptainShip(false) != null)
            {
                cutInType = CutInType.Both;
            }
            else if (this._clsKoukuu2.GetCaptainShip(true) != null)
            {
                cutInType = CutInType.FriendOnly;
            }
            else
            {
                cutInType = CutInType.EnemyOnly;
            }
            if (cutInType == CutInType.Both)
            {
                battleCameras.SetSplitCameras2D(true);
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else
            {
                if (cutInType == CutInType.FriendOnly)
                {
                    cutInEffectCamera.isCulling = false;
                }
                battleCameras.SetSplitCameras2D(false);
            }
            this._prodAerialSecondP1.get_gameObject().SetActive(true);
            this._prodAerialSecondP1.Play(new Action(this._onAerialSecondPhase1Finished));
            return(false);
        }
Пример #24
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)));
        }
Пример #25
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)));
        }
 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;
 }
Пример #27
0
        private void _onAircraftSecondFinished()
        {
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(false);
            BattleCutInCamera       cutInCamera       = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask = Generics.Layers.CutIn;
            cutInCamera.depth             = 5f;
            cutInEffectCamera.depth       = 4f;
            cutInEffectCamera.glowEffect.set_enabled(true);
            this.PlayProdDamage(this._clsKoukuu2, delegate
            {
                this.EndPhase(BattleUtils.NextPhase(BattlePhase.AerialCombatSecond));
            });
            if (this._prodAerialSecondP2 != null)
            {
                Object.Destroy(this._prodAerialSecondP2.get_gameObject());
            }
            if (this._prodAerialTouchPlane != null)
            {
                this._prodAerialTouchPlane.Hide();
            }
        }
Пример #28
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

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

            _prodAerialTouchPlane.SetActive(isActive: true);
            _prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            _prodAerialCombatP2.Play(_onAircraftCombatFinished, dicFriendBattleShips, dicEnemyBattleShips);
            Object.Destroy(_prodAerialCombatP1.gameObject);
            return(false);
        }
Пример #29
0
        private void _onAircraftCombatFinished()
        {
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(isSplit: false);
            BattleCutInCamera       cutInCamera       = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInCamera.cullingMask              = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask        = Generics.Layers.CutIn;
            cutInCamera.depth                    = 5f;
            cutInEffectCamera.depth              = 4f;
            cutInEffectCamera.glowEffect.enabled = false;
            PlayProdDamage(_clsKoukuu, delegate
            {
                EndPhase(BattleUtils.NextPhase(BattlePhase.AerialCombat));
            });
            if (_prodAerialCombatP2 != null)
            {
                Object.Destroy(_prodAerialCombatP2.gameObject);
            }
            if (_prodAerialTouchPlane != null)
            {
                _prodAerialTouchPlane.Hide();
            }
        }
Пример #30
0
        private void _onAircraftCombatFinished()
        {
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(false);
            BattleCutInCamera       cutInCamera       = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask = Generics.Layers.CutIn;
            cutInCamera.depth             = 5f;
            cutInEffectCamera.depth       = 4f;
            cutInEffectCamera.glowEffect.set_enabled(true);
            this.PlayProdDamage(this._clsKoukuu1, delegate
            {
                this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this._initAerialSecondCutIn), new StatementMachine.StatementMachineUpdate(this._updateAerialSecondCutIn));
            });
            if (this._prodAerialCombatP2 != null)
            {
                Object.Destroy(this._prodAerialCombatP2.get_gameObject());
            }
            if (this._prodAerialTouchPlane != null)
            {
                this._prodAerialTouchPlane.Hide();
            }
        }