コード例 #1
0
        private new void Start()
        {
            InitBattleData();
            _clsSettingModel   = new SettingModel();
            _iPhase            = (_iPhaseReq = BattlePhase.BattlePhase_BEF);
            _traStage          = base.transform.FindChild("Stage");
            _clsBattleShips    = new BattleShips();
            _clsBattleCameras  = new BattleCameras();
            _clsBattleHPGauges = new BattleHPGauges();
            _clsBattleField    = base.transform.GetComponentInChildren <BattleField>();
            UICircleHPGauge    circleHPGauge    = _clsBattlePrefabFile.circleHPGauge;
            UIBattleNavigation battleNavigation = _clsBattlePrefabFile.battleNavigation;

            battleNavigation.panel.depth = 100;
            _clsTorpedoHpGauges          = new TorpedoHpGauges();
            _clsBattleShips.Init(GetBattleManager());
            _clsBattleField.ReqTimeZone(GetStartTimeZone(GetBattleManager().WarType), GetSkyType());
            KCV.Utils.SoundUtils.SwitchBGM((BGMFileInfos)GetBattleManager().GetBgmId());
            ProdSortieTransitionToBattle psttb = (SortieBattleTaskManager.GetSortieBattlePrefabFile() != null) ? SortieBattleTaskManager.GetSortieBattlePrefabFile().prodSortieTransitionToBattle : ProdSortieTransitionToBattle.Instantiate(Resources.Load <ProdSortieTransitionToBattle>("Prefabs/SortieMap/SortieTransitionToBattle/ProdSortieTransitionToBattle"), _clsBattleCameras.cutInCamera.transform).QuickFadeInInit();

            Observable.FromCoroutine((UniRx.IObserver <float> observer) => InitBattle(observer)).Subscribe(delegate(float x)
            {
                if (x == 1f)
                {
                    _iPhase = (_iPhaseReq = BattlePhase.FleetAdvent);
                    Observable.Timer(TimeSpan.FromSeconds(0.30000001192092896)).Subscribe(delegate
                    {
                        _clsBattleField.AlterWaveDirection(FleetType.Friend);
                        psttb.Play(ProdSortieTransitionToBattle.AnimationName.ProdSortieTransitionToBattleFadeIn, delegate
                        {
                            if (SortieBattleTaskManager.GetSortieBattlePrefabFile() != null)
                            {
                                SortieBattleTaskManager.GetSortieBattlePrefabFile().DisposeProdSortieTransitionToBattle();
                            }
                            else
                            {
                                UnityEngine.Object.Destroy(psttb.gameObject);
                            }
                            if (SortieBattleTaskManager.GetTransitionCamera() != null)
                            {
                                SortieBattleTaskManager.GetTransitionCamera().enabled = false;
                            }
                            Mem.Del(ref psttb);
                        });
                    });
                }
            }).AddTo(base.gameObject);
        }
コード例 #2
0
        private IEnumerator OnCommitBattleStartCoroutine(BattlePracticeContext context)
        {
            yield return(new WaitForEndOfFrame());

            if (context.BattleStartType == BattlePracticeContext.PlayType.Battle)
            {
                mPracticeHeader.UpdateHeaderText(string.Empty);
                RetentionData.SetData(new Hashtable
                {
                    {
                        "rootType",
                        Generics.BattleRootType.Practice
                    },
                    {
                        "areaId",
                        SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID
                    },
                    {
                        "practiceManager",
                        mPracticeManager
                    },
                    {
                        "formation",
                        context.FormationType
                    },
                    {
                        "deckID",
                        context.TargetDeck.Id
                    }
                });
                yield return(new WaitForEndOfFrame());

                GameObject prefab = Resources.Load("Prefabs/SortieMap/SortieTransitionToBattle/ProdSortieTransitionToBattle") as GameObject;
                ProdSortieTransitionToBattle smokeProduction = ProdSortieTransitionToBattle.Instantiate(prefab.GetComponent <ProdSortieTransitionToBattle>(), base.transform);
                yield return(new WaitForEndOfFrame());

                bool animationFinished = false;
                smokeProduction.Play(delegate
                {
                    animationFinished = true;
                });
                while (!animationFinished)
                {
                    yield return(new WaitForEndOfFrame());
                }
                if (SingletonMonoBehaviour <PortObjectManager> .exist())
                {
                    SingletonMonoBehaviour <PortObjectManager> .Instance.ManualRelease();

                    UnityEngine.Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                    SingletonMonoBehaviour <PortObjectManager> .Instance = null;
                }
                yield return(new WaitForEndOfFrame());

                SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType  = AppInformation.LoadType.White;
                SingletonMonoBehaviour <AppInformation> .Instance.NextLoadScene = Generics.Scene.Battle;
                Application.LoadLevel("LoadingScene");
            }
            else
            {
                mPracticeHeader.UpdateHeaderText(string.Empty);
                PracticeManager  practiceManager = new PracticeManager(context.FriendDeck.Id);
                BattleCutManager bcm             = BattleCutManager.Instantiate(mPrefab_BattleCutManager, new Vector3(20f, 0f));
                yield return(new WaitForEndOfFrame());

                bcm.StartBattleCut(practiceManager, context.TargetDeck.Id, context.FormationType, delegate
                {
                    SingletonMonoBehaviour <PortObjectManager> .Instance.SceneLoad(Generics.Scene.Strategy);
                });
            }
        }