private void TryReconnect()
 {
     _modalViewController.Show("Reconnecting...");
     _networkManager.Connect(allowOfflineMode: false).Subscribe(Observer.Create <NetworkConnectionResult>(result => {
         _modalViewController.Hide();
     },
                                                                                                          error => {
         TryReconnect();
     }));
 }
        public IObservable <Unit> Run()
        {
            _modalViewController.Show("Loading Assets...");
            // TODO: Commands to use unitask. this should just be all async / await
            MapStoreId mapStoreId = new MapStoreId(_data.mapIndex);
            IObservable <IMutableMapData> mapDataObservable = _mapStore.LoadMap(mapStoreId).ToObservable();

            mapDataObservable.Subscribe(mapData => {
                _sceneLoader.LoadSceneAsync(_data.SceneName,
                                            LoadSceneMode.Additive,
                                            container => {
                    HandleMapSceneLoaded(container, mapData, mapStoreId);
                });
            });

            return(_sceneLoadedSubject);
        }
Exemple #3
0
        public void Initialize()
        {
            var observables = new List <IObservable <AssetBinding> >();

            foreach (var assetLoadingFunction in _assetLoadingFunctions)
            {
                observables.Add(assetLoadingFunction.Invoke());
            }

            _modalViewController.Show("Loading Assets...");
            // NOTE: Not good practice!
            // Maybe use oncomplete to bind on container?
            observables.Merge().Subscribe(binding => _container
                                          .Bind(binding.type)
                                          .FromInstance(binding.asset),
                                          () => {
                _modalViewController.Hide();
                _sceneLoader.LoadScene(_nextScene, LoadSceneMode.Additive);
            });
        }