Beispiel #1
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();
        }
        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;
            }
            }
        }