Example #1
0
 public void Play()
 {
     widget.alpha = 1f;
     UniRx.IObservable <Unit> source  = Observable.FromCoroutine(InDisplay);
     UniRx.IObservable <Unit> source2 = Observable.FromCoroutine(WaitRoll);
     Observable.FromCoroutine(StartRoll);
     source.SelectMany(source2.SelectMany(StartRoll)).Subscribe();
 }
Example #2
0
 public bool Init(BattleManager manager)
 {
     if (manager == null)
     {
         return(false);
     }
     _traFriendFleetAnchor = GameObject.Find("FriendFleetAnchor").transform;
     _traEnemyFleetAnchor  = GameObject.Find("EnemyFleetAnchor").transform;
     _dicFriendBattleShips = new Dictionary <int, UIBattleShip>();
     _dicEnemyBattleShips  = new Dictionary <int, UIBattleShip>();
     UniRx.IObservable <Unit> source = Observable.FromCoroutine(() => CreateBattleShips(manager.Ships_f, manager.FormationId_f, _traFriendFleetAnchor.gameObject, _dicFriendBattleShips, FleetType.Friend, manager.ShipCount_f, 0));
     UniRx.IObservable <Unit> other  = Observable.FromCoroutine(() => CreateBattleShips(manager.Ships_e, manager.FormationId_e, _traEnemyFleetAnchor.gameObject, _dicEnemyBattleShips, FleetType.Enemy, manager.ShipCount_e, 0));
     source.SelectMany(other).Subscribe(delegate
     {
         _uiOriginalShip = null;
         _isInitialize   = true;
     });
     return(true);
 }
Example #3
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);
        }