Example #1
0
        public UniRx.IObservable <bool> Play()
        {
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.CommandBuffer);
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

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

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.pointOfGaze        = Vector3.Lerp(BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Friend].position, BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Enemy].position, 0.8f);
            battleFieldCamera.vignetting.enabled = true;
            battleFieldCamera.glowEffect.enabled = true;
            battleShips.SetBollboardTarget(null);
            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;
            }
            Observable.NextFrame().Subscribe(delegate
            {
                CalcInitLineRotation();
                PlayLineAnimation();
            });
            return(Observable.FromCoroutine((UniRx.IObserver <bool> observer) => AnimationObserver(observer)));
        }
Example #2
0
        public IObservable <bool> Play()
        {
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.CommandBuffer);
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

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

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.pointOfGaze = Vector3.Lerp(BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Friend).get_position(), BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Enemy).get_position(), 0.8f);
            battleFieldCamera.vignetting.set_enabled(true);
            battleFieldCamera.glowEffect.set_enabled(true);
            battleShips.SetBollboardTarget(null);
            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;
            }
            Observable.NextFrame(FrameCountType.Update).Subscribe(delegate(Unit _)
            {
                this.CalcInitLineRotation();
                this.PlayLineAnimation();
            });
            return(Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.AnimationObserver(observer)));
        }
        private void onInitBackground()
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.ResetFleetAnchorPosition();
            BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SwitchMainCamera(FleetType.Friend);
            battleCameras.InitEnemyFieldCameraDefault();
            BattleFieldCamera friendFieldCamera = battleCameras.friendFieldCamera;
            BattleFieldCamera enemyFieldCamera  = battleCameras.enemyFieldCamera;

            battleCameras.isFieldDimCameraEnabled = false;
            friendFieldCamera.ResetMotionBlur();
            friendFieldCamera.clearFlags  = CameraClearFlags.Skybox;
            friendFieldCamera.cullingMask = battleCameras.GetDefaultLayers();
            enemyFieldCamera.cullingMask  = battleCameras.GetEnemyCamSplitLayers();
            battleCameras.SetVerticalSplitCameras(isSplit: true);
            friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            enemyFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Friend].position;

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

            enemyFieldCamera.transform.position = new Vector3(-51f, 8f, -90f);
            enemyFieldCamera.transform.rotation = Quaternion.Euler(new Vector3(10.5f, 111f, 0f));
            battleField.isEnemySeaLevelActive   = true;
            battleField.AlterWaveDirection(FleetType.Friend, FleetType.Friend);
            battleField.AlterWaveDirection(FleetType.Enemy, FleetType.Enemy);
            BattleShips battleShips2 = BattleTaskManager.GetBattleShips();

            battleShips2.RadarDeployment(isDeploy: false);
            battleShips2.SetBollboardTarget(isFriend: false, enemyFieldCamera.transform);
            battleShips2.SetTorpedoSalvoWakeAngle(isSet: true);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 1f;
            }
            BattleTaskManager.GetBattleCameras().fieldDimCamera.maskAlpha = 0f;
            foreach (UIBattleShip value in BattleTaskManager.GetBattleShips().dicFriendBattleShips.Values)
            {
                value.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().friendFieldCamera.transform;
            }
            foreach (UIBattleShip value2 in BattleTaskManager.GetBattleShips().dicEnemyBattleShips.Values)
            {
                value2.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().enemyFieldCamera.transform;
            }
        }
Example #4
0
        private void onInitBackground()
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.ResetFleetAnchorPosition();
            BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SwitchMainCamera(FleetType.Friend);
            battleCameras.InitEnemyFieldCameraDefault();
            BattleFieldCamera friendFieldCamera = battleCameras.friendFieldCamera;
            BattleFieldCamera enemyFieldCamera  = battleCameras.enemyFieldCamera;

            battleCameras.isFieldDimCameraEnabled = false;
            friendFieldCamera.ResetMotionBlur();
            friendFieldCamera.clearFlags  = 1;
            friendFieldCamera.cullingMask = battleCameras.GetDefaultLayers();
            enemyFieldCamera.cullingMask  = battleCameras.GetEnemyCamSplitLayers();
            battleCameras.SetVerticalSplitCameras(true);
            friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            enemyFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors.get_Item(CameraAnchorType.OneRowAnchor).get_Item(FleetType.Friend).get_position();

            friendFieldCamera.get_transform().set_position(new Vector3(-51f, 8f, 90f));
            friendFieldCamera.get_transform().set_localRotation(Quaternion.Euler(new Vector3(10.5f, 70f, 0f)));
            Vector3 position2 = battleField.dicCameraAnchors.get_Item(CameraAnchorType.OneRowAnchor).get_Item(FleetType.Enemy).get_position();

            enemyFieldCamera.get_transform().set_position(new Vector3(-51f, 8f, -90f));
            enemyFieldCamera.get_transform().set_rotation(Quaternion.Euler(new Vector3(10.5f, 111f, 0f)));
            battleField.isEnemySeaLevelActive = true;
            battleField.AlterWaveDirection(FleetType.Friend, FleetType.Friend);
            battleField.AlterWaveDirection(FleetType.Enemy, FleetType.Enemy);
            BattleShips battleShips2 = BattleTaskManager.GetBattleShips();

            battleShips2.RadarDeployment(false);
            battleShips2.SetBollboardTarget(false, enemyFieldCamera.get_transform());
            battleShips2.SetTorpedoSalvoWakeAngle(true);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = cutInEffectCamera.get_transform().FindChild("TorpedoLine/OverlayLine").GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 1f;
            }
            BattleTaskManager.GetBattleCameras().fieldDimCamera.maskAlpha = 0f;
            using (Dictionary <int, UIBattleShip> .ValueCollection.Enumerator enumerator = BattleTaskManager.GetBattleShips().dicFriendBattleShips.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    UIBattleShip current = enumerator.get_Current();
                    current.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().friendFieldCamera.get_transform();
                }
            }
            using (Dictionary <int, UIBattleShip> .ValueCollection.Enumerator enumerator2 = BattleTaskManager.GetBattleShips().dicEnemyBattleShips.get_Values().GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    UIBattleShip current2 = enumerator2.get_Current();
                    current2.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().enemyFieldCamera.get_transform();
                }
            }
        }