Exemplo n.º 1
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.º 2
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();
        }
Exemplo n.º 3
0
    private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer)
    {
        if (_isAnimating)
        {
            observer.OnNext(0);
            observer.OnCompleted();
            yield break;
        }
        _isAnimating   = true;
        _anim          = default(Anim);
        _anim.isEval   = true;
        _beginRotation = Quaternion.LookRotation(-DirectionXZ);
        string anim = "TurnAnimation";

        _animation.Play(anim);

        throw new NotImplementedException("‚È‚É‚±‚ê");
        //yield return new WaitForSeconds(_animation.get_Item(anim).length);
        yield return(new WaitForSeconds(0));

        _anim.isEval = false;
        _isAnimating = false;
        observer.OnNext(0);
        observer.OnCompleted();
        _beginRotation = null;
    }
Exemplo n.º 4
0
 public static UniRx.IObservable <T> Previous <T>(this UniRx.IObservable <T> source)
 {
     return(Observable.Create(delegate(UniRx.IObserver <T> observer)
     {
         bool initialized = false;
         T newest = (T)default(T);
         UniRx.IObservable <T> source2 = source;
         Action <T> onNext = delegate(T x)
         {
             if (!initialized)
             {
                 initialized = true;
             }
             else
             {
                 observer.OnNext((T)newest);
             }
             newest = (T)x;
         };
         UniRx.IObserver <T> observer2 = observer;
         Action <Exception> onError = observer2.OnError;
         UniRx.IObserver <T> observer3 = observer;
         return source2.Subscribe(onNext, onError, observer3.OnCompleted);
     }));
 }
Exemplo n.º 5
0
    private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer)
    {
        if (_isAnimating)
        {
            observer.OnNext(0);
            observer.OnCompleted();
            yield break;
        }
        _isAnimating = true;
        DebugUtils.dbgAssert(_shakeCurve.length >= 1);
        float     duration        = _shakeCurve.keys[_shakeCurve.length - 1].time;
        float     beginTime       = Time.time;
        Transform transform       = base.transform;
        Vector3   initialPosition = transform.localPosition;

        while (true)
        {
            float t = Time.time - beginTime;
            if (t > duration)
            {
                break;
            }
            float   basePower = _shakeCurve.Evaluate(t);
            float   rt        = t * (float)Math.PI * 2f * 20f;
            float   rn        = Mathf.PerlinNoise(t * 8f, 0f) * (float)Math.PI * 2f;
            Vector3 direction = new Vector3(Mathf.Cos(rt + rn), Mathf.Sin(rt + rn), 0f);
            transform.localPosition = initialPosition + direction * basePower * _shakePower;
            yield return(null);
        }
        transform.localPosition = initialPosition;
        _isAnimating            = false;
        observer.OnNext(0);
        observer.OnCompleted();
    }
        private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer)
        {
            if (_isAnimating)
            {
                observer.OnNext(0);
                observer.OnCompleted();
                yield break;
            }
            _isAnimating             = true;
            _searchLightFocus        = default(SearchLightFocus);
            _searchLightFocus.isEval = true;
            _referenceCameraTransform.transform.eulerAngles = Vector3.zero;
            string anim = "SearchLightFocusAndBack";

            _animation.Play(anim);

            throw new NotImplementedException("‚È‚É‚±‚ê");
            // yield return new WaitForSeconds(_animation.get_Item(anim).length);
            yield return(new WaitForSeconds(0));

            _searchLightFocus.isEval = false;
            _isAnimating             = false;
            observer.OnNext(0);
            observer.OnCompleted();
        }
Exemplo n.º 7
0
 public static UniRx.IObservable <T> Catch <T>(this UniRx.IObservable <T> source, Func <Exception, UniRx.IObservable <T> > onError)
 {
     return(Observable.Create(delegate(UniRx.IObserver <T> observer)
     {
         UniRx.IObservable <T> source2 = source;
         Action <T> onNext = delegate(T x)
         {
             observer.OnNext(x);
         };
         Action <Exception> onError2 = delegate(Exception e)
         {
             UniRx.IObservable <T> source3 = onError(e);
             Action <T> onNext2 = delegate(T x)
             {
                 observer.OnNext(x);
             };
             UniRx.IObserver <T> observer3 = observer;
             Action <Exception> onError3 = observer3.OnError;
             UniRx.IObserver <T> observer4 = observer;
             source3.Subscribe(onNext2, onError3, observer4.OnCompleted);
         };
         UniRx.IObserver <T> observer2 = observer;
         return source2.Subscribe(onNext, onError2, observer2.OnCompleted);
     }));
 }
        private IEnumerator CreateTorpedoCutIn(UniRx.IObserver <bool> observer)
        {
            BattleCutInEffectCamera cam = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture centerLine        = ((Component)cam.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (centerLine != null)
            {
                centerLine.alpha = 0f;
            }
            _prodTorpedoCutIn = ProdTorpedoCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdTorpedoCutIn).GetComponent <ProdTorpedoCutIn>(), _clsRaigeki, cam.transform);
            BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers();
            yield return(new WaitForEndOfFrame());

            prefabProdTorpedoStraight = (UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform);
            Transform transP4 = new GameObject().transform;

            transP4.name            = "ProdTorpedoSalvoPhase2";
            _prodTorpedoSalvoPhase2 = new ProdTorpedoSalvoPhase2(transP4, ((Component)prefabProdTorpedoStraight).GetComponent <TorpedoStraightController>());
            _prodTorpedoSalvoPhase2.Initialize(_clsRaigeki, TorpedoParticle, centerLine);
            yield return(new WaitForEndOfFrame());

            Transform transP3 = new GameObject().transform;

            transP3.name            = "ProdTorpedoSalvoPhase3";
            _prodTorpedoSalvoPhase3 = new ProdTorpedoSalvoPhase3(transP3);
            _prodTorpedoSalvoPhase3.Initialize(_clsRaigeki, TorpedoParticle);
            yield return(new WaitForEndOfFrame());

            _prodTorpedoSalvoPhase3.SetHpGauge();
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 9
0
        private IEnumerator SearchLight_FlareBullet_Coroutine(UniRx.IObserver <int> observer)
        {
            BattleFieldCamera camera            = BattleTaskManager.GetBattleCameras().fieldCameras[0];
            Vector3?          searchPointOfGaze = GetSearchLightShipPointOfGaze();

            if (searchPointOfGaze.HasValue)
            {
                _ctrlSearchLight.ReferenceCameraTransform    = camera.transform;
                _ctrlSearchLight.SearchLightCameraStartPivot = camera.transform.position;
                _ctrlSearchLight.SearchLightPivot            = searchPointOfGaze.Value;
                yield return(_ctrlSearchLight.PlayAnimation().StartAsCoroutine(delegate
                {
                }, delegate
                {
                }));
            }
            Vector3?flarePointOfGaze = GetFlareBulletShipPointOfGaze();

            if (flarePointOfGaze.HasValue)
            {
                _ctrlFlareBullet.ReferenceCameraTransform    = camera.transform;
                _ctrlFlareBullet.FlareBulletCameraStartPivot = camera.transform.position;
                _ctrlFlareBullet.FlareBulletFirePivot        = flarePointOfGaze.Value;
                yield return(_ctrlFlareBullet.PlayAnimation().StartAsCoroutine(delegate
                {
                }, delegate
                {
                }));
            }
            observer.OnNext(0);
            observer.OnCompleted();
        }
Exemplo n.º 10
0
    private IEnumerator Creator(string path, HttpMethod httpMethod, byte[] formData, UniRx.IObserver <string> observer, CancellationToken cancellationToken)
    {
        string url = $"{m_baseUrl}{path}";

        switch (httpMethod)
        {
        case HttpMethod.PUT:
            using (UnityWebRequest www = UnityWebRequest.Put(url, formData)) {
                www.SendWebRequest();
                while (!www.isDone && !cancellationToken.IsCancellationRequested)
                {
                    yield return(null);
                }

                if (cancellationToken.IsCancellationRequested)
                {
                    yield break;
                }

                if (www.isNetworkError || www.isHttpError)
                {
                    observer.OnError(new Exception(www.error));
                }
                else
                {
                    observer.OnNext(www.downloadHandler.text);
                    observer.OnCompleted();
                }
            }
            break;

        default:
            break;
        }
    }
Exemplo n.º 11
0
        private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer)
        {
            if (_isAnimating)
            {
                observer.OnNext(0);
                observer.OnCompleted();
                yield break;
            }
            _isAnimating = true;
            _binding._smoke.enableEmission = true;
            _anim._shine = 0f;
            yield return(new WaitForSeconds(_params._delay));

            string anim = "FlareBullet";

            _binding._animation.Play(anim);
            yield return(new WaitForSeconds(_binding._animation.GetClip(anim).length));

            _binding._smoke.enableEmission = false;
            yield return(new WaitForSeconds(3f));

            _anim._shine = 0f;
            _isAnimating = false;
            observer.OnNext(0);
            observer.OnCompleted();
        }
Exemplo n.º 12
0
        private IEnumerator PlayDecideAnimation(UniRx.IObserver <bool> observer)
        {
            yield return(null);

            _listDifficultyBtn.ForEach(delegate(UIDifficultyBtn x)
            {
                // _003CPlayDecideAnimation_003Ec__Iterator1A0 _003CPlayDecideAnimation_003Ec__Iterator1A = this;
                if (x.index == this._nIndex)
                {
                    UIWritingBrush uIWritingBrush     = UIWritingBrush.Instantiate(this._prefabUIWritingBrush.GetComponent <UIWritingBrush>(), this.transform);
                    uIWritingBrush.transform.position = x.wrightBrushAnchor.position;
                    uIWritingBrush.Play(delegate
                    {
                        Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate
                        {
                            observer.OnNext(value: true);
                            observer.OnCompleted();
                        });
                    });
                    x.ShowDifficultyRedLabel();
                }
                else
                {
                    x.transform.LTValue(1f, 0.5f, 0.2f).setEase(LeanTweenType.linear).setOnUpdate(delegate(float y)
                    {
                        x.widget.alpha = y;
                    });
                }
            });
        }
Exemplo n.º 13
0
        protected virtual IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 14
0
            public IEnumerator Hide(UniRx.IObserver <bool> observer)
            {
                _tra.LTScaleY(0f, 0.3f).setEase(LeanTweenType.easeOutCubic);
                yield return(new WaitForSeconds(0.3f));

                observer.OnNext(value: true);
                observer.OnCompleted();
            }
Exemplo n.º 15
0
 private IEnumerator InitBattle(UniRx.IObserver <float> observer)
 {
     observer.OnNext(0f);
     while (!_clsBattleShips.isInitialize)
     {
         yield return(null);
     }
     observer.OnNext(1f);
     observer.OnCompleted();
 }
        protected override IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            base.animation.Play(AnimationList.ProdBufferTorpedoSalvo.ToString());
            SoundUtils.PlaySE(SEFIleInfos.SE_926a);
            throw new NotImplementedException("‚È‚É‚±‚ê");
            // yield return new WaitForSeconds(base.animation.get_Item(AnimationList.ProdBufferTorpedoSalvo.ToString()).length);
            yield return(new WaitForSeconds(0));

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 17
0
        private IEnumerator CreateBCBattle(UniRx.IObserver <ProdBCBattle> observer)
        {
            if (_prodBCBattle == null)
            {
                _prodBCBattle = ProdBCBattle.Instantiate(((Component)BattleCutManager.GetPrefabFile().prefabProdBCBattle).GetComponent <ProdBCBattle>(), BattleCutManager.GetSharedPlase());
            }
            yield return(null);

            observer.OnNext(_prodBCBattle);
            observer.OnCompleted();
        }
        protected override IDisposable SubscribeCore(UniRx.IObserver <T> observer, IDisposable cancel)
        {
            if (predicate == null)
            {
                return(source.Subscribe(new FirstOrEmpty(observer, cancel)));
            }

            else
            {
                return(source.Subscribe(new FirstOrEmpty_(this, observer, cancel)));
            }
        }
Exemplo n.º 19
0
        public static IEnumerator Instantiate(UniRx.IObserver <BattleShutter> observer, BattleShutter prefab, Transform parent, int nPanelDepth)
        {
            BattleShutter obj = UnityEngine.Object.Instantiate(prefab);

            obj.transform.parent        = parent;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localPosition = Vector3.zero;
            yield return(null);

            observer.OnNext(obj);
            observer.OnCompleted();
        }
 static IEnumerator RunAsyncOperation(UnityEngine.AsyncOperation asyncOperation, UniRx.IObserver <float> observer, CancellationToken cancellationToken)
 {
     while (!asyncOperation.isDone && !cancellationToken.IsCancellationRequested)
     {
         observer.OnNext(asyncOperation.progress);
         yield return(null);
     }
     if (!cancellationToken.IsCancellationRequested)
     {
         observer.OnNext(asyncOperation.progress); // push 100%
         observer.OnCompleted();
     }
 }
        public IDisposable Subscribe(UniRx.IObserver <T> observer)
        {
            if (observer == null)
            {
                return(Disposable.Empty);
            }

            var enumerator = new ToObservableEnumerator(coroutine().ToCoroutine(), observer);

            manager.Start(enumerator);

            return(enumerator.Cancellation);
        }
Exemplo n.º 22
0
        private IEnumerator CreateTorpedoPhase2(UniRx.IObserver <bool> observer)
        {
            Transform torpedoStraight = UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform;
            Transform trams           = new GameObject().transform;

            trams.name = "ProdTorpedoSalvoPhase2";
            _prodTorpedoSalvoPhase2 = new ProdTorpedoSalvoPhase2(trams, ((Component)torpedoStraight).GetComponent <TorpedoStraightController>());
            _prodTorpedoSalvoPhase2.Initialize(_clsRaigeki, TorpedoParticle, CenterLine);
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 23
0
        public void RxSendRequest <T>(UniRx.IObserver <T> o, Converter.Converter convert, object request)
        {
            HttpClientRequest httpClientRequest = request as HttpClientRequest;

            if (httpClientRequest != null)
            {
                if (EnableDebug)
                {
                    Debug.LogFormat("Send on threadId:{0}", System.Threading.Thread.CurrentThread.ManagedThreadId);
                }
                httpClientRequest.Send();
            }
        }
Exemplo n.º 24
0
        private IEnumerator AnimationObserver(UniRx.IObserver <bool> observer)
        {
            LeanTweenType iType = LeanTweenType.easeOutQuad;

            sprite.alpha = 0f;
            sprite.transform.localScaleZero();
            yield return(new WaitForEndOfFrame());

            float fAnimTime6 = 0.2f;

            base.transform.LTValue(sprite.alpha, 1f, fAnimTime6).setEase(iType).setOnUpdate(delegate(float x)
            {
                throw new NotImplementedException("なにこれ");
                // this.sprite.alpha = x;
            });
            base.transform.LTMoveLocalY(16f, fAnimTime6).setEase(iType);
            base.transform.LTScale(Vector3.one, fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            fAnimTime6 = 0.2f;
            base.transform.LTMoveLocalY(0f, fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            fAnimTime6 = 0.2f;
            base.transform.LTMoveLocalY(-7f, fAnimTime6);
            base.transform.LTScale(new Vector3(1.3f, 0.3f, 0f), fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            fAnimTime6 = 0.2f;
            base.transform.LTMoveLocalY(6f, fAnimTime6);
            base.transform.LTScale(Vector3.one, fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            fAnimTime6 = 0.2f;
            base.transform.LTMoveLocalY(0f, fAnimTime6);
            base.transform.LTScale(Vector3.one, fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            fAnimTime6 = 0.1f;
            base.transform.LTValue(sprite.alpha, 0f, fAnimTime6).setEase(iType).setOnUpdate(delegate(float x)
            {
                throw new NotImplementedException("なにこれ");
                // this.sprite.alpha = x;
            });
            base.transform.LTMoveLocalY(0f, fAnimTime6);
            base.transform.LTScale(Vector3.one, fAnimTime6);
            yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 25
0
        private IEnumerator PlayPortBackEo(UniRx.IObserver <bool> observer)
        {
            SortieBattleTaskManager.GetMapManager();
            UISortieShip      uiss = SortieMapTaskManager.GetUIMapManager().sortieShip;
            MapEventItemModel meim = SortieBattleTaskManager.GetMapManager().GetItemEvent();

            yield return(new WaitForSeconds(1.5f));

            uiss.PlayBalloon(meim, delegate
            {
                throw new NotImplementedException("なにこれ");
                // base.observer.OnNext(value: true);
                // base.observer.OnCompleted();
            });
        }
Exemplo n.º 26
0
        private IEnumerator CreateTorpedoPhase3(UniRx.IObserver <bool> observer)
        {
            Transform trams = new GameObject().transform;

            trams.name = "ProdTorpedoSalvoPhase3";
            _prodTorpedoSalvoPhase3 = new ProdTorpedoSalvoPhase3(trams);
            _prodTorpedoSalvoPhase3.Initialize(_clsRaigeki, TorpedoParticle);
            yield return(new WaitForEndOfFrame());

            _prodTorpedoSalvoPhase3.SetHpGauge();
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
        private IEnumerator _createTorpedoWake(UniRx.IObserver <bool> observer)
        {
            Dictionary <int, UIBattleShip> _dicFriendShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> _dicEnemyShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            _listTorpedoWake = new List <PSTorpedoWake>();
            _createTorpedo(FleetType.Friend, _dicFriendShips, _dicEnemyShips);
            yield return(new WaitForEndOfFrame());

            _createTorpedo(FleetType.Enemy, _dicEnemyShips, _dicFriendShips);
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 28
0
        private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer)
        {
            if (_isAnimating)
            {
                observer.OnNext(0);
                observer.OnCompleted();
                yield break;
            }
            _isAnimating = true;
            SetupFragment();
            yield return(new WaitForSeconds(2f));

            _isAnimating = false;
            observer.OnNext(0);
            observer.OnCompleted();
        }
Exemplo n.º 29
0
        public object RxBuildRequest <T>(UniRx.IObserver <T> o, Converter.Converter convert, RestMethodInfo methodInfo, string url)
        {
            Action <HttpResponseMessage <string> > responseMessage = message =>
            {
                string errorMessage = "";
                if (IsRequestError(message, out errorMessage))
                {
                    o.OnError(new Exception(errorMessage));
                    return;
                }
                string result = GetSuccessResponse(message);
                //                        result = "[]";
                //                        result = "[asd..s]";
                if (EnableDebug)
                {
                    Debug.LogFormat("Raw Response:{0}", result);
                }
                //Parse Json By Type
                if (typeof(T) == typeof(string))
                {
                    var resultData = (T)(object)result;
                    o.OnNext(resultData);
                    o.OnCompleted();
                    return;
                }
                T    data        = default(T);
                bool formatError = false;
                try
                {
                    data = convert.FromBody <T>(result);
                }
                catch (ConversionException e)
                {
                    formatError = true;
                    o.OnError(new Exception(e.Message));
                }
                if (!formatError)
                {
                    o.OnNext(data);
                    o.OnCompleted();
                }
            };
            HttpClientRequest httpClientRequest = new HttpClientRequest(new Uri(url), responseMessage);

            ConfigureRESTfulApi(methodInfo, httpClientRequest);
            return(httpClientRequest);
        }
Exemplo n.º 30
0
        private IEnumerator PlayExclamationPointAnimationObserver(UniRx.IObserver <bool> observer)
        {
            GameObject anchor = new GameObject("ProdExclamationPointAnchor");

            anchor.transform.parent = base.transform;
            anchor.transform.localScaleOne();
            anchor.transform.localPosition = Vector3.up * 32f;
            ProdExclamationPoint pxp = ProdExclamationPoint.Instantiate(((Component)_prefabProdExclamationPoint).GetComponent <ProdExclamationPoint>(), anchor.transform);

            yield return(pxp.Play().StartAsCoroutine());

            UnityEngine.Object.Destroy(anchor.gameObject);
            Mem.DelComponentSafe(ref pxp);
            observer.OnNext(value: true);
            observer.OnCompleted();
            yield return(Observable.NextFrame(FrameCountType.EndOfFrame).StartAsCoroutine());
        }