Exemplo n.º 1
0
        //protected override IEnumerator AnimationObserver(IObserver<bool> observer)
        protected IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            MapManager            mm    = SortieBattleTaskManager.GetMapManager();
            UIMapManager          uimm  = SortieMapTaskManager.GetUIMapManager();
            UIAreaMapFrame        uiamf = SortieMapTaskManager.GetUIAreaMapFrame();
            UISortieShipCharacter uissc = SortieMapTaskManager.GetUIShipCharacter();
            bool   isShipWait           = true;
            bool   isItemGetWait        = true;
            string empty = string.Empty;
            string str   = (!_clsEventItemModel.IsMaterial()) ? $"{SortieUtils.ConvertItem2String(_clsEventItemModel.ItemID)}x{_clsEventItemModel.Count.ToString()}\nを入手しました!" : $"{SortieUtils.ConvertMatCategory2String(_clsEventItemModel.MaterialCategory)}x{_clsEventItemModel.Count.ToString()}\nを入手しました!";

            uiamf.SetMessage(str);
            yield return(null);

            uissc.SetShipData(GetTargetShip(mm.Deck));
            uissc.ShowInItemGet(delegate
            {
                throw new NotImplementedException("なにこれ");
                // base._003CisShipWait_003E__4 = false;
            });
            uissc.SetInDisplayNextMove(isInDisplay: false);
            uimm.sortieShip.PlayGetMaterialOrItem(_clsEventItemModel, delegate
            {
                throw new NotImplementedException("なにこれ");
                // base._003Cuiamf_003E__2.ClearMessage();
                // base._003CisItemGetWait_003E__5 = false;
            });
            while (isShipWait || isItemGetWait)
            {
                yield return(null);
            }
            observer.OnNext(value: true);
            observer.OnCompleted();
        }
        private void StartupUIMapManager(Transform prefabAreaMap)
        {
            MapManager mapManager = SortieBattleTaskManager.GetMapManager();

            _uiMapManager = UIMapManager.Instantiate(mapManager, (!(prefabAreaMap != null)) ? null : ((Component)prefabAreaMap).GetComponent <UIMapManager>(), _uiRoot.transform.FindChild("MapGenerator"), ((Component)_clsSortiePrefabFile.prefabUISortieShip).GetComponent <UISortieShip>());
            _uiSortieMapName.SetMapInformation(mapManager);
        }
Exemplo n.º 3
0
        protected override IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            UIMapManager          uimm  = SortieMapTaskManager.GetUIMapManager();
            UIAreaMapFrame        uiamf = SortieMapTaskManager.GetUIAreaMapFrame();
            UISortieShipCharacter uissc = SortieMapTaskManager.GetUIShipCharacter();
            bool isWait = true;

            uissc.SetInDisplayNextMove(isInDisplay: false);
            uiamf.SetMessage("艦隊の前方にうずしおが発生しました!");
            yield return(Observable.NextFrame(FrameCountType.EndOfFrame).StartAsCoroutine());

            uimm.nextCell.PlayMailstrom(uimm.sortieShip, _clsEventHappeningModel, delegate
            {
                base._003CisWait_003E__3 = false;
            });
            while (isWait)
            {
                yield return(null);
            }
            uiamf.SetMessage(string.Format((!_clsEventHappeningModel.Dentan) ? "{0}x{1}を\n落としてしまいました…。" : "{0}x{1}を\n落としてしまいました…。\n(電探が役立って、被害を抑えられた!)", SortieUtils.ConvertMatCategory2String(_clsEventHappeningModel.Material), _clsEventHappeningModel.Count));
            yield return(Observable.Timer(TimeSpan.FromSeconds(2.0)).StartAsCoroutine());

            uiamf.ClearMessage();
            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 4
0
        public static UIMapManager Instantiate(MapManager manager, UIMapManager prefab, Transform parent, UISortieShip sortieShip)
        {
            UIMapManager uIMapManager = (!(prefab != null)) ? Util.InstantiatePrefab($"SortieMap/AreaMap/Map{manager.Map.MstId}", parent.gameObject).GetComponent <UIMapManager>() : Object.Instantiate(prefab);

            uIMapManager.transform.parent = parent;
            uIMapManager.transform.localPositionZero();
            uIMapManager.transform.localScale = Vector3.one * 1.1f;
            uIMapManager.Init(manager, sortieShip);
            return(uIMapManager);
        }
Exemplo n.º 5
0
        public static UIMapManager Instantiate(MapManager manager, UIMapManager prefab, Transform parent, UISortieShip sortieShip)
        {
            UIMapManager uIMapManager = (!(prefab != null)) ? Util.InstantiatePrefab(string.Format("SortieMap/AreaMap/Map{0}", manager.Map.MstId), parent.get_gameObject(), false).GetComponent <UIMapManager>() : Object.Instantiate <UIMapManager>(prefab);

            uIMapManager.get_transform().set_parent(parent);
            uIMapManager.get_transform().localPositionZero();
            uIMapManager.get_transform().set_localScale(Vector3.get_one() * 1.1f);
            uIMapManager.Init(manager, sortieShip);
            return(uIMapManager);
        }
Exemplo n.º 6
0
 private void ChkLinkCellAfterPassed()
 {
     if (_clsCellModel.GetLinkNo().Count != 0)
     {
         UIMapManager uimm = SortieMapTaskManager.GetUIMapManager();
         _clsCellModel.GetLinkNo().ForEach(delegate(int x)
         {
             uimm.cells[x].SetActive(isActive: false);
         });
         _uiCell.depth++;
     }
 }
 private void ChkLinkCellAfterPassed()
 {
     if (this._clsCellModel.GetLinkNo().get_Count() != 0)
     {
         UIMapManager uimm = SortieMapTaskManager.GetUIMapManager();
         this._clsCellModel.GetLinkNo().ForEach(delegate(int x)
         {
             uimm.cells.get_Item(x).SetActive(false);
         });
         this._uiCell.depth++;
     }
 }
Exemplo n.º 8
0
        private IEnumerator ChkProduction(MapManager manager, UIMapManager uiManager, UISortieShip ship)
        {
            MapProductionKind production = manager.Production;

            if (production == MapProductionKind.WaterPlane && uiManager.nowCell != null)
            {
                bool isFinished = false;
                ship.PlayDetectionAircraft(uiManager.nowCell, uiManager.nextCell, delegate
                {
                    isFinished = true;
                });
                while (!isFinished)
                {
                    yield return(null);
                }
            }
        }
Exemplo n.º 9
0
 private IEnumerator ChkCompass(MapManager manager, UIMapManager uiManager, UISortieShip ship)
 {
     if (manager.hasCompass())
     {
         SortieMapTaskManager.GetUIAreaMapFrame().SetMessage("どこに進む?");
         UICompassManager uicm   = UICompassManager.Instantiate(((Component)SortieMapTaskManager.GetPrefabFile().prefabUICompassManager).GetComponent <UICompassManager>(), SortieMapTaskManager.GetSharedPlace(), SortieBattleTaskManager.GetMapManager().CompassId, ship.transform, uiManager.nextCell.transform);
         bool             isWait = false;
         uicm.Play(delegate
         {
             isWait = true;
         });
         while (!isWait)
         {
             yield return(new WaitForEndOfFrame());
         }
         Mem.DelComponentSafe(ref uicm);
     }
 }
Exemplo n.º 10
0
        private IEnumerator PlayStupid(UniRx.IObserver <bool> observer, enumMapWarType iWarType)
        {
            UIMapManager   uimm         = SortieMapTaskManager.GetUIMapManager();
            UIAreaMapFrame uiamf        = SortieMapTaskManager.GetUIAreaMapFrame();
            UIMapManager   uiMapManager = SortieMapTaskManager.GetUIMapManager();

            uimm.nextCell.PlayRipple(Color.red);
            uiMapManager.nextCell.SetPassedDefaultColor();
            yield return(SortieMapTaskManager.GetUIMapManager().sortieShip.PlayExclamationPoint().StartAsCoroutine());

            uiamf.SetMessage(enumMapEventType.Stupid, iWarType);
            yield return(new WaitForSeconds(1f));

            uimm.nextCell.StopRipple();
            uiMapManager.UpdateCellState(uiMapManager.nextCell.cellModel.CellNo, isPassed: true);
            uiamf.ClearMessage();
            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 11
0
        private IEnumerator ShipMove(UniRx.IObserver <bool> observer)
        {
            MapManager   manager      = SortieBattleTaskManager.GetMapManager();
            UIMapManager uiMapManager = SortieMapTaskManager.GetUIMapManager();
            UISortieShip sortieShip   = uiMapManager.sortieShip;

            UniRx.IObservable <Unit> underwayReplenishmentUnit = Observable.FromCoroutine(() => this.ChkUnderwayReplenishment(manager));
            UniRx.IObservable <Unit> compassUnit    = Observable.FromCoroutine(() => this.ChkCompass(manager, uiMapManager, sortieShip));
            UniRx.IObservable <Unit> productionUnit = Observable.FromCoroutine(() => this.ChkProduction(manager, uiMapManager, sortieShip));
            UniRx.IObservable <Unit> synthesisUnit  = Observable.SelectMany(other: Observable.FromCoroutine(() => this.ChkComment(manager, sortieShip)), source: underwayReplenishmentUnit.SelectMany(compassUnit).SelectMany(productionUnit));
            yield return(synthesisUnit.StartAsCoroutine());

            CheckNextBossCell(manager);
            sortieShip.Move(uiMapManager.nextCell, delegate
            {
                uiMapManager.UpdateRouteState(uiMapManager.nextCell.cellModel.CellNo);
                observer.OnNext(value: true);
                observer.OnCompleted();
            });
            yield return(null);
        }
        protected override IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            UIMapManager   uimm  = SortieMapTaskManager.GetUIMapManager();
            UISortieShip   uiss  = uimm.sortieShip;
            UIAreaMapFrame uiamf = SortieMapTaskManager.GetUIAreaMapFrame();

            uiamf.SetMessage(_clsEventModel.AircraftType);
            Transform airRecPoint = null;

            if (uimm.airRecPoint.ContainsKey(uimm.nextCell.cellModel.CellNo))
            {
                airRecPoint = uimm.airRecPoint[uimm.nextCell.cellModel.CellNo];
            }
            bool isWait2 = true;

            uiss.PlayAirReconnaissance(_clsEventModel.AircraftType, uiss.transform, airRecPoint, delegate
            {
                throw new NotImplementedException("なにこれ");
                // base._003CisWait_003E__4 = false;
            });
            while (isWait2)
            {
                yield return(null);
            }
            isWait2 = true;
            uiss.PlayBalloon(_clsEventModel, SortieBattleTaskManager.GetMapManager().GetItemEvent(), delegate
            {
                throw new NotImplementedException("なにこれ");
                // base._003CisWait_003E__4 = false;
            });
            while (isWait2)
            {
                yield return(null);
            }
            uiamf.ClearMessage();
            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 13
0
        public void Play(enumMapEventType iEventType, enumMapWarType iWarType, Action <bool> onFinished)
        {
            this._actOnFinished = onFinished;
            switch (iEventType)
            {
            case enumMapEventType.NOT_USE:
                this.OnFinished();
                break;

            case enumMapEventType.None:
                this.OnFinished();
                break;

            case enumMapEventType.ItemGet:
            {
                UIMapManager uIMapManager = SortieMapTaskManager.GetUIMapManager();
                uIMapManager.UpdateCellState(uIMapManager.nextCell.cellModel.CellNo, true);
                MapEventItemModel itemEvent = SortieBattleTaskManager.GetMapManager().GetItemEvent();
                EventItemGet      eig       = new EventItemGet(itemEvent);
                eig.PlayAnimation().Subscribe(delegate(bool _)
                    {
                        eig.Dispose();
                        Mem.Del <EventItemGet>(ref eig);
                        this.OnFinished();
                    });
                break;
            }

            case enumMapEventType.Uzushio:
            {
                UIMapManager uIMapManager2 = SortieMapTaskManager.GetUIMapManager();
                uIMapManager2.UpdateCellState(uIMapManager2.nextCell.cellModel.CellNo, true);
                MapEventHappeningModel happeningEvent = SortieBattleTaskManager.GetMapManager().GetHappeningEvent();
                EventMailstrom         em             = new EventMailstrom(happeningEvent);
                em.PlayAnimation().Subscribe(delegate(bool _)
                    {
                        em.Dispose();
                        Mem.Del <EventMailstrom>(ref em);
                        this.OnFinished();
                    });
                break;
            }

            case enumMapEventType.War_Normal:
            case enumMapEventType.War_Boss:
            {
                UIMapManager uIMapManager3 = SortieMapTaskManager.GetUIMapManager();
                uIMapManager3.UpdateCellState(uIMapManager3.nextCell.cellModel.CellNo, true);
                Observable.FromCoroutine(() => this.EventEnemy(iEventType), false).Subscribe <Unit>();
                break;
            }

            case enumMapEventType.Stupid:
                Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.PlayStupid(observer, iWarType)).Subscribe(delegate(bool _)
                {
                    this.OnFinished();
                });
                break;

            case enumMapEventType.AirReconnaissance:
            {
                UIMapManager uIMapManager4 = SortieMapTaskManager.GetUIMapManager();
                uIMapManager4.UpdateCellState(uIMapManager4.nextCell.cellModel.CellNo, true);
                MapEventAirReconnaissanceModel airReconnaissanceEvent = SortieBattleTaskManager.GetMapManager().GetAirReconnaissanceEvent();
                EventAirReconnaissance         ear = new EventAirReconnaissance(airReconnaissanceEvent);
                ear.PlayAnimation().Subscribe(delegate(bool _)
                    {
                        ear.Dispose();
                        Mem.Del <EventAirReconnaissance>(ref ear);
                        this.OnFinished();
                    });
                break;
            }

            case enumMapEventType.PortBackEo:
            {
                UIMapManager uIMapManager5 = SortieMapTaskManager.GetUIMapManager();
                uIMapManager5.UpdateCellState(uIMapManager5.nextCell.cellModel.CellNo, true);
                Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.PlayPortBackEo(observer)).Subscribe(delegate(bool _)
                    {
                        this.OnFinished();
                    });
                break;
            }
            }
        }
Exemplo n.º 14
0
        private IEnumerator EventEnemy(enumMapEventType iEventType)
        {
            SortieBattleTaskManager.GetMapManager();
            UIMapManager   uimm  = SortieMapTaskManager.GetUIMapManager();
            UIAreaMapFrame uiamf = SortieMapTaskManager.GetUIAreaMapFrame();

            uimm.nextCell.PlayRipple(Color.red);
            yield return(SortieMapTaskManager.GetUIMapManager().sortieShip.PlayExclamationPoint().StartAsCoroutine());

            if (SortieMapTaskManager.GetShortCutSwitch().isShortCut&& SortieMapTaskManager.GetShortCutSwitch().isValid)
            {
                UIWobblingIcon uiwi2 = uimm.wobblingIcons.wobblingIcons[uimm.nextCell.cellModel.CellNo];
                if (uiwi2 != null)
                {
                    bool isWait2 = true;
                    uiwi2.Show().setOnComplete((Action) delegate
                    {
                        isWait2 = false;
                    });
                    while (!isWait2)
                    {
                        yield return(Observable.NextFrame(FrameCountType.EndOfFrame).StartAsCoroutine());
                    }
                    yield return(new WaitForSeconds(1.5f));
                }
                SortieBattleTaskManager.ReqMode(SortieBattleMode.BattleCut);
                SortieMapTaskManager.GetUIAreaMapFrame().Hide();
                uimm.nextCell.StopRipple();
                if (uiwi2 != null)
                {
                    uiwi2.Hide().setOnComplete((Action) delegate
                    {
                        UnityEngine.Object.Destroy(uiwi2.gameObject);
                    });
                }
                yield return(null);

                yield break;
            }
            UIWobblingIcon uiwi = uimm.wobblingIcons.wobblingIcons[uimm.nextCell.cellModel.CellNo];

            if (uiwi != null)
            {
                bool isWait = true;
                uiwi.Show().setOnComplete((Action) delegate
                {
                    throw new NotImplementedException("なにこれ");
                    // base._003CisWait_003E__6 = false;
                });
                while (!isWait)
                {
                    yield return(Observable.NextFrame(FrameCountType.EndOfFrame).StartAsCoroutine());
                }
                yield return(new WaitForSeconds(1.5f));
            }
            _isNormalBattle = true;
            uiamf.ClearMessage();
            uimm.nextCell.StopRipple();
            OnFinished();
            yield return(null);
        }