public void StartMessage(float st, float lt, float et, string msg, int mode)
    {
        if (Object.op_Equality((Object)null, (Object)this.cgrp))
        {
            return;
        }
        this.endMode     = mode;
        this.looptime    = lt;
        this.exitCommand = false;
        IObservable <float> observable1 = (IObservable <float>)Observable.Scan <float>((IObservable <M0>)Observable.Select <Unit, float>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this), (Func <M0, M1>)(_ => Time.get_deltaTime())), (Func <M0, M0, M0>)((acc, current) => acc + current));
        IObservable <float> observable2 = (IObservable <float>)Observable.TakeWhile <float>((IObservable <M0>)observable1, (Func <M0, bool>)(t => (double)t < (double)st));
        IObservable <float> loopStream  = (IObservable <float>)Observable.TakeWhile <float>((IObservable <M0>)observable1, (Func <M0, bool>)(t => !this.CheckEnd(t)));
        IObservable <float> endStream   = (IObservable <float>)Observable.TakeWhile <float>((IObservable <M0>)observable1, (Func <M0, bool>)(t => (double)t < (double)et));

        this.disposables.Clear();
        if (Object.op_Implicit((Object)this.txt))
        {
            this.txt.set_text(msg);
        }
        this.cgrp.set_blocksRaycasts(true);
        this.active = true;
        DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <float>((IObservable <M0>)observable2, (Action <M0>)(t => this.cgrp.set_alpha(Mathf.Lerp(0.0f, 1f, Mathf.InverseLerp(0.0f, st, t)))), (Action)(() =>
        {
            this.cgrp.set_alpha(1f);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <float>((IObservable <M0>)loopStream, (Action <M0>)(t => {}), (Action)(() => DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <float>((IObservable <M0>)endStream, (Action <M0>)(t => this.cgrp.set_alpha(Mathf.Lerp(1f, 0.0f, Mathf.InverseLerp(0.0f, et, t)))), (Action)(() =>
            {
                this.cgrp.set_alpha(0.0f);
                this.cgrp.set_blocksRaycasts(false);
                this.active = false;
            })), (ICollection <IDisposable>) this.disposables))), (ICollection <IDisposable>) this.disposables);
        })), (ICollection <IDisposable>) this.disposables);
    }
Example #2
0
 public void StartWithAnimalSequence(AnimalBase animal, int actorPoseID, int animalPoseID)
 {
     if (Object.op_Equality((Object)animal, (Object)null))
     {
         return;
     }
     switch (this)
     {
     case AgentActor _:
     case PlayerActor _:
         this._withAnimalEnumerator = this.StartWithAnimalSequenceCoroutine(animal, actorPoseID, animalPoseID);
         animal.SetImpossible(true, this);
         animal.SetState(!(this is AgentActor) ? AnimalState.WithPlayer : AnimalState.WithAgent, (System.Action)null);
         if (this._withAnimalDisposable != null)
         {
             this._withAnimalDisposable.Dispose();
         }
         this._withAnimalDisposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => this._withAnimalEnumerator), false), (System.Action <M0>)(_ => {}), (System.Action <Exception>)(ex =>
         {
             Debug.LogException(ex);
             this._withAnimalEnumerator = (IEnumerator)null;
         }), (System.Action)(() => this._withAnimalEnumerator = (IEnumerator)null)), (Component)this);
         break;
     }
 }
Example #3
0
    private void Start()
    {
        for (int index1 = 0; index1 < 12; ++index1)
        {
            this.color[index1] = Color.HSVToRGB(0.0f, 0.0f, (float)(1.0 - (double)index1 * 0.0199999995529652));
        }
        int index = 0;

        DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Interval(TimeSpan.FromMilliseconds(50.0)), (Action <M0>)(_ =>
        {
            if (this.update)
            {
                index = (index + 11) % 12;
                for (int index1 = 0; index1 < 12; ++index1)
                {
                    int index2 = (index + index1) % 12;
                    ((Graphic)this.img[index1]).set_color(this.color[index2]);
                }
            }
            for (int index1 = 0; index1 < 12; ++index1)
            {
                ((Behaviour)this.img[index1]).set_enabled(this.update);
            }
        })), (Component)this);
    }
        public void TryDispose_ValidParam_ReturnsTrueAndCallsDispose()
        {
            var fake = new FakeDisposable();

            Assert.IsTrue(DisposableExtensions.TryDispose(fake));
            Assert.IsTrue(fake.WasCalled);
        }
Example #5
0
        public ItemNodeUI AddItemNode(int id, StuffItem item)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            ItemListUI.\u003CAddItemNode\u003Ec__AnonStorey2 nodeCAnonStorey2 = new ItemListUI.\u003CAddItemNode\u003Ec__AnonStorey2();
            // ISSUE: reference to a compiler-generated field
            nodeCAnonStorey2.id = id;
            // ISSUE: reference to a compiler-generated field
            nodeCAnonStorey2.\u0024this = this;
            StuffItemInfo itemInfo = ItemNodeUI.GetItemInfo(item);

            if (itemInfo == null)
            {
                return((ItemNodeUI)null);
            }
            GameObject gameObject = itemInfo.isNone ? ItemListUI.SystemNode : this.OptionNode;

            // ISSUE: reference to a compiler-generated field
            nodeCAnonStorey2.opt = (ItemNodeUI)((GameObject)Object.Instantiate <GameObject>((M0)gameObject, this.itemParent)).GetComponent <ItemNodeUI>();
            // ISSUE: reference to a compiler-generated field
            nodeCAnonStorey2.opt.Bind(item, itemInfo);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated method
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)nodeCAnonStorey2.opt.onEnter, (Action <M0>) new Action <PointerEventData>(nodeCAnonStorey2.\u003C\u003Em__0)), (Component)this);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: method pointer
            ((UnityEvent)nodeCAnonStorey2.opt.OnClick).AddListener(new UnityAction((object)nodeCAnonStorey2, __methodptr(\u003C\u003Em__1)));
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            this._optionTable.Add(nodeCAnonStorey2.id, nodeCAnonStorey2.opt);
            // ISSUE: reference to a compiler-generated field
            return(nodeCAnonStorey2.opt);
        }
Example #6
0
        private void InventoryUISetting()
        {
            IEnumerator pouchCoroutine = this.InventoryUISettingCoroutine(this._pouchInventoryUI);
            IEnumerator chestCoroutine = this.InventoryUISettingCoroutine(this._chestInventoryUI);
            IConnectableObservable <Unit> iconnectableObservable1 = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => pouchCoroutine), false));
            IConnectableObservable <Unit> iconnectableObservable2 = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => chestCoroutine), false));

            iconnectableObservable1.Connect();
            iconnectableObservable2.Connect();
            IEnumerator decidedCoroutine = this.ItemListUISettingCoroutine(this._decidedItemSlotUI.ListController, PanelType.DecidedItem);
            IEnumerator createdCoroutine = this.ItemListUISettingCoroutine(this._createItemStockUI.ListController, PanelType.CreatedItem);
            IConnectableObservable <Unit> iconnectableObservable3 = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => decidedCoroutine), false));
            IConnectableObservable <Unit> iconnectableObservable4 = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => createdCoroutine), false));

            iconnectableObservable3.Connect();
            iconnectableObservable4.Connect();
            IEnumerator warningCoroutine = this.LoadWarningViewerCoroutine();
            IConnectableObservable <Unit> iconnectableObservable5 = (IConnectableObservable <Unit>)Observable.Publish <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => warningCoroutine), false));

            iconnectableObservable5.Connect();
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.WhenAll(new IObservable <Unit>[5]
            {
                (IObservable <Unit>)iconnectableObservable1,
                (IObservable <Unit>)iconnectableObservable2,
                (IObservable <Unit>)iconnectableObservable3,
                (IObservable <Unit>)iconnectableObservable4,
                (IObservable <Unit>)iconnectableObservable5
            }), (Action <M0>)(_ => this.FinishedInventoryUISetting()), (Action <Exception>)(ex => Debug.LogException(ex))), (Component)this);
        }
        public void PlayFadeOut(float fadeTime)
        {
            this._fadeDisposable.Clear();
            IEnumerator coroutine = this.FadeOut(fadeTime);

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (ICollection <IDisposable>) this._fadeDisposable);
        }
Example #8
0
        public void TryDispose_ValidParam_ReturnsTrueAndCallsDispose()
        {
            var mockDisposable = new Mock <IDisposable>();

            Assert.IsTrue(DisposableExtensions.TryDispose(mockDisposable.Object));
            mockDisposable.Verify(x => x.Dispose());
        }
Example #9
0
        public virtual void LogMethodDone(Stopwatch timing, object[] args, int maxAllowedTimeInMs, string sourceMemberName, string sourceFilePath, int sourceLineNumber)
        {
            var    timingV2   = timing as StopwatchV2;
            string methodName = sourceMemberName;

            if (timingV2 != null)
            {
                timingV2.StopV2();
                methodName = timingV2.methodName;
            }
            else
            {
                timing.Stop();
            }
            EventBus.instance.Publish(EventConsts.catMethod + EventConsts.DONE, methodName, timing);
            var text = "    <-- " + methodName + " finished after " + timing.ElapsedMilliseconds + " ms";

            if (timingV2 != null)
            {
                text += ", " + timingV2.GetAllocatedMemBetweenStartAndStop();
            }
           #if DEBUG
            if (DisposableExtensions.DEBUG_ThrownExceptionDetectedInCurrentContext())
            {
                text += " (DUE TO EXCEPTION THROWN)";
            }
           #endif
            text = $"{text} \n at {sourceFilePath}: line {sourceLineNumber}";
            Log.d(text, new StackFrame(1, true).AddTo(args));
            if (maxAllowedTimeInMs > 0)
            {
                timing.AssertUnderXms(maxAllowedTimeInMs);
            }
        }
Example #10
0
        private void SetActiveControl(bool active)
        {
            this._allDisposable.Clear();
            IEnumerator coroutine = !active?this.CloseCoroutine() : this.OpenCoroutine();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false), (Component)this)), (ICollection <IDisposable>) this._allDisposable);
        }
Example #11
0
 private void Awake()
 {
     this._hypJpn = ((Component)this._messageLabel).GetOrAddComponent <HyphenationJpn>();
     ((ReactiveProperty <string>) this._name).set_Value(string.Empty);
     UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._name, this._nameLabel);
     ((ReactiveProperty <string>) this._message).set_Value(string.Empty);
     UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._message, this._messageLabel);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._advWindowRootVisible, (Action <M0>)(isOn =>
     {
         this._advWindowRootCG.set_alpha(!isOn ? 0.0f : 1f);
         this._advWindowRootCG.set_blocksRaycasts(isOn);
     })), (Component)this._advWindowRootCG);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._advWindowVisible, (Action <M0>)(isOn =>
     {
         this._advWindowCG.set_alpha(!isOn ? 0.0f : 1f);
         this._advWindowCG.set_blocksRaycasts(isOn);
     })), (Component)this._advWindowCG);
     ObservableExtensions.Subscribe <bool>((IObservable <M0>)Observable.Select <string, bool>((IObservable <M0>) this._message, (Func <M0, M1>)(s => !s.IsNullOrEmpty())), (Action <M0>)(isOn => ((ReactiveProperty <bool>) this._advWindowVisible).set_Value(isOn)));
     ((Behaviour)this).set_enabled(false);
     ((Graphic)this._windowImage).set_color(Color.op_Subtraction(Color.get_black(), Color.op_Multiply(Color.get_black(), 0.5f)));
     if (Object.op_Inequality((Object)this._nameFrameImage, (Object)null))
     {
         ((Graphic)this._nameFrameImage).set_color(Color.get_black());
     }
     ObservableExtensions.Subscribe <int>(Observable.TakeUntilDestroy <int>((IObservable <M0>) this._fontSpeed, (Component)this), (Action <M0>)(value =>
     {
         this._typefaceAnimator.isNoWait = value == 100;
         if (this._typefaceAnimator.isNoWait)
         {
             return;
         }
         this._typefaceAnimator.timeMode = TypefaceAnimatorEx.TimeMode.Speed;
         this._typefaceAnimator.speed    = (float)value;
     }));
 }
        protected override void OnAfterStart()
        {
            base.OnAfterStart();
            IEnumerator coroutine = this.CreateElements();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
        private void Start()
        {
            float backMousePos = 0.0f;
            ObservableEventTrigger observableEventTrigger = (ObservableEventTrigger)((Component)this).get_gameObject().AddComponent <ObservableEventTrigger>();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <float>((IObservable <M0>)Observable.Select <Unit, float>(Observable.RepeatUntilDestroy <Unit>(Observable.TakeUntil <Unit, PointerEventData>(Observable.SkipUntil <Unit, PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this), (IObservable <M1>)Observable.Do <PointerEventData>((IObservable <M0>)observableEventTrigger.OnPointerDownAsObservable(), (Action <M0>)(_ =>
            {
                backMousePos = (float)Input.get_mousePosition().x;
                if (!Object.op_Implicit((Object)this.imgCol))
                {
                    return;
                }
                ((Graphic)this.imgCol).set_color(new Color((float)((Graphic)this.imgCol).get_color().r, (float)((Graphic)this.imgCol).get_color().g, (float)((Graphic)this.imgCol).get_color().b, 1f));
            }))), (IObservable <M1>)Observable.Do <PointerEventData>((IObservable <M0>)observableEventTrigger.OnPointerUpAsObservable(), (Action <M0>)(_ =>
            {
                if (!Object.op_Implicit((Object)this.imgCol))
                {
                    return;
                }
                ((Graphic)this.imgCol).set_color(new Color((float)((Graphic)this.imgCol).get_color().r, (float)((Graphic)this.imgCol).get_color().g, (float)((Graphic)this.imgCol).get_color().b, 0.0f));
            }))), (Component)this), (Func <M0, M1>)(_ => (float)Input.get_mousePosition().x - backMousePos)), (Action <M0>)(move =>
            {
                backMousePos = (float)Input.get_mousePosition().x;
                if (this.type == 0 && this.xyz == 0)
                {
                    move *= -1f;
                }
                this.customAcsCorrectSet.UpdateDragValue(this.type, this.xyz, move);
            })), (Component)this);
        }
        public void StartFadeOut()
        {
            this.Dispose();
            this.fadeOutDisposable = new CompositeDisposable();
            IEnumerator _coroutine = this.FadeOutCoroutine();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDisable <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false), (Component)this)), (ICollection <IDisposable>) this.fadeOutDisposable);
        }
Example #15
0
        protected override void OnAfterStart()
        {
            base.OnAfterStart();
            this.SetActive(((Component)this).get_gameObject(), false);
            IEnumerator coroutine = this.LoadElementSprites();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
        private void StartChange()
        {
            this.Dispose();
            this.changeDisposable = new CompositeDisposable();
            IEnumerator _coroutine = this.ChangeCoroutine();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false), (Component)this)), (ICollection <IDisposable>) this.changeDisposable);
        }
Example #17
0
 public void Init()
 {
     if (this.isInit)
     {
         return;
     }
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this.button), (Component)this.imageCursor), (Action <M0>)(_ => ((Behaviour)this.imageCursor).set_enabled(true))), this.gameObject);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this.button), (Component)this.imageCursor), (Action <M0>)(_ => ((Behaviour)this.imageCursor).set_enabled(false))), this.gameObject);
     this.isInit = true;
 }
Example #18
0
 public void Start()
 {
     this.Refresh();
     if (Object.op_Equality((Object)this._toggle, (Object)null) || Object.op_Equality((Object)this._cursor, (Object)null))
     {
         return;
     }
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._toggle), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this._cursor, (Object)null))), (Action <M0>)(_ => ((Behaviour)this._cursor).set_enabled(true))), (Component)this._toggle);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._toggle), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this._cursor, (Object)null))), (Action <M0>)(_ => ((Behaviour)this._cursor).set_enabled(false))), (Component)this._toggle);
 }
Example #19
0
        private void SetActiveControl(bool active)
        {
            if (this._fadeDisposable != null)
            {
                this._fadeDisposable.Dispose();
            }
            IEnumerator coroutine = !active?this.CloseCoroutine() : this.OpenCoroutine();

            this._fadeDisposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
        protected virtual void StartWaypointRetention()
        {
            IEnumerator coroutine = this.WaypointRetentionCoroutine();

            if (this._waypointRetentionDisposable != null)
            {
                this._waypointRetentionDisposable.Dispose();
            }
            this._waypointRetentionDisposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
Example #21
0
        public void StartSlidUp(float _posY)
        {
            if (this.slidUpDisposable != null)
            {
                this.slidUpDisposable.Dispose();
            }
            this.slidUpDisposable = new CompositeDisposable();
            IEnumerator _coroutine = this.SlidUpCoroutine(_posY);

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDisable <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false), ((Component)this).get_gameObject())), (ICollection <IDisposable>) this.slidUpDisposable);
        }
Example #22
0
 public SubscriptionResult(
     SubscriptionResult subscriptionResult,
     IDisposable?session = null)
 {
     _resultStreamFactory = subscriptionResult._resultStreamFactory;
     _errors      = subscriptionResult._errors;
     _extensions  = subscriptionResult._extensions;
     _contextData = subscriptionResult._contextData;
     _session     = session is null
         ? subscriptionResult
         : DisposableExtensions.Combine((IAsyncDisposable)subscriptionResult, session);
 }
        public void StartDisplay()
        {
            if (this.displayDisposable != null)
            {
                this.displayDisposable.Dispose();
            }
            this.displayDisposable = new CompositeDisposable();
            this.CanvasAlpha       = this.displayAlpha;
            IEnumerator _coroutine = this.OnDisplay();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDisable <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false), (Component)this), (Action <M0>)(_ => {}), (Action)(() => this.displayDisposable = (CompositeDisposable)null)), (ICollection <IDisposable>) this.displayDisposable);
        }
        public void CloseMessage()
        {
            if (this.PlayingFadeOut)
            {
                return;
            }
            this.Dispose();
            this.fadeOutDisposable = new CompositeDisposable();
            IEnumerator _coroutine = this.FadeOut();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDisable <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _coroutine), false), (Component)this), (Action <M0>)(_ => {}), (Action)(() => this.fadeOutDisposable = (CompositeDisposable)null)), (ICollection <IDisposable>) this.fadeOutDisposable);
        }
Example #25
0
 private void Start()
 {
     if (!Object.op_Inequality((Object)this._cg, (Object)null))
     {
         return;
     }
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>(Observable.TakeUntilDestroy <bool>((IObservable <M0>) this.visible, (Component)this._cg), (Action <M0>)(isOn =>
     {
         this._cg.set_alpha(!isOn ? 0.0f : 1f);
         this._cg.set_blocksRaycasts(isOn);
     })), (Component)this);
 }
Example #26
0
 public void Close(float fadeTime, float moveX)
 {
     if (this.IsClosing)
     {
         return;
     }
     if (this.IsOpening)
     {
         this.Dispose();
     }
     this._closeEnumerator = this.CloseCoroutine(fadeTime, moveX);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => this._closeEnumerator), false)), (ICollection <IDisposable>) this._allDisposable);
 }
Example #27
0
        private void OnSelectChara(int _idx)
        {
            if (this.charaFileSort.select == _idx)
            {
                return;
            }
            this.charaFileSort.select = _idx;
            ((Selectable)this.buttonLoad).set_interactable(true);
            OCIChar ctrlInfo = Studio.Studio.GetCtrlInfo(Singleton <Studio.Studio> .Instance.treeNodeCtrl.selectNode) as OCIChar;

            ((Selectable)this.buttonChange).set_interactable(ctrlInfo != null && ctrlInfo.oiCharInfo.sex == this.sex);
            this.isDelay = true;
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromMilliseconds(250.0)), (Action <M0>)(_ => this.isDelay = false)), (Component)this);
        }
        public void ShowMessage(string _mes)
        {
            this.Dispose();
            this.IsForcedClose = false;
            ((TMP_Text)this.messageText).set_text(_mes);
            if (this.fadeInDisposable != null)
            {
                this.fadeInDisposable.Dispose();
            }
            this.fadeInDisposable = new CompositeDisposable();
            this.CanvasAlpha      = 0.0f;
            IEnumerator _fadeInCoroutine = this.FadeIn();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDisable <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => _fadeInCoroutine), false), (Component)this), (Action <M0>)(_ => {}), (Action)(() => this.fadeInDisposable = (CompositeDisposable)null)), (ICollection <IDisposable>) this.fadeInDisposable);
        }
Example #29
0
        protected override void OnAfterStart()
        {
            if (this._canvasGroup.get_blocksRaycasts())
            {
                this._canvasGroup.set_blocksRaycasts(false);
            }
            if (this._canvasGroup.get_interactable())
            {
                this._canvasGroup.set_interactable(false);
            }
            this.CanvasAlpha = 0.0f;
            this.SetActive((Component)this._canvasGroup, false);
            IEnumerator coroutine = this.CreateElements();

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
Example #30
0
        protected override void OnBeforeStart()
        {
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(x => this.SetActiveControl(x))), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <string>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this._numInputField), (Action <M0>)(str => this.OnInputFieldValueChanged(str))), (Component)this);
            for (int index = 0; index < this._numChangeValues.Length; ++index)
            {
                Button element = this._numChangeButtons.GetElement <Button>(index);
                if (!Object.op_Equality((Object)element, (Object)null))
                {
                    int changeValue = this._numChangeValues[index];
                    DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(element), (Action <M0>)(_ => this.OnNumChangeClick(changeValue))), (Component)this);
                    DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(element), (Action <M0>)(_ => this._recyclingUI.PlaySE(SoundPack.SystemSE.OK_S))), (Component)this);
                }
            }
            if (!this._buttons.IsNullOrEmpty <Button>())
            {
                foreach (Button button in this._buttons)
                {
                    if (!Object.op_Equality((Object)button, (Object)null))
                    {
                        DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(button), (Action <M0>)(_ => this._recyclingUI.PlaySE(SoundPack.SystemSE.OK_S))), (Component)this);
                    }
                }
            }
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>) this.ClickDelete, (Action <M0>)(_ => this.OnClickDeleteButton())), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <RecyclingInventoryFacadeViewer>(Observable.Where <RecyclingInventoryFacadeViewer>(Observable.Where <RecyclingInventoryFacadeViewer>((IObservable <M0>) this._recyclingUI.OnInventoryChanged, (Func <M0, bool>)(_ => this.ItemInfo.Item5 == 1)), (Func <M0, bool>)(_ => this.ItemInfo.Item2 != null)), (Action <M0>)(receiver => this.ItemInfo.Item2 = (__Null)receiver.ListController)), (Component)this);
            IObservable <Unit> observable1 = (IObservable <Unit>)Observable.Select <RecyclingInventoryFacadeViewer, Unit>((IObservable <M0>) this._recyclingUI.OnInventoryChanged, (Func <M0, M1>)(_ => Unit.get_Default()));
            IObservable <Unit> observable2 = (IObservable <Unit>)Observable.Select <StuffItem, Unit>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>((IObservable <M0>) this._recyclingUI.DecidedItemSlotUI.DeleteEvent, (Func <M0, bool>)(_ => this.ItemInfo.Item5 == 1)), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Func <M0, bool>)(item => item != null)), (Func <M0, bool>)(item => ((ItemNodeUI)this.ItemInfo.Item3).Item == item)), (Func <M0, bool>)(item => 0 < item.Count)), (Func <M0, M1>)(_ => Unit.get_Default()));
            IObservable <Unit> observable3 = (IObservable <Unit>)Observable.Select <StuffItem, Unit>(Observable.Where <StuffItem>(Observable.Where <StuffItem>((IObservable <M0>) this._recyclingUI.DecidedItemSlotUI.DeleteEvent, (Func <M0, bool>)(_ => this.ItemInfo.Item5 == 0)), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Func <M0, M1>)(_ => Unit.get_Default()));
            IObservable <Unit> observable4 = (IObservable <Unit>)Observable.DelayFrame <Unit>((IObservable <M0>)Observable.Select <PanelType, Unit>(Observable.Where <PanelType>((IObservable <M0>) this._recyclingUI.OnDoubleClicked, (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Func <M0, M1>)(_ => Unit.get_Default())), 1, (FrameCountType)0);
            IObservable <Unit> observable5 = (IObservable <Unit>)Observable.Select <StuffItem, Unit>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>((IObservable <M0>) this._recyclingUI.CreateItemStockUI.OnAddCreateItem, (Func <M0, bool>)(item => item != null)), (Func <M0, bool>)(_ => this.ItemInfo.Item5 == 2)), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Func <M0, M1>)(_ => Unit.get_Default()));
            IObservable <Unit> observable6 = (IObservable <Unit>)Observable.DelayFrame <Unit>((IObservable <M0>) this._recyclingUI.CreateItemStockUI.OnClickDeleteSubmit, 1, (FrameCountType)0);

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>(Observable.Merge <Unit>((IObservable <M0>[]) new IObservable <Unit>[9]
            {
                (IObservable <Unit>)Observable.DelayFrame <Unit>((IObservable <M0>) this.ClickDecide, 1, (FrameCountType)0),
                (IObservable <Unit>)Observable.DelayFrame <Unit>((IObservable <M0>) this.ClickReturn, 1, (FrameCountType)0),
                (IObservable <Unit>)Observable.DelayFrame <Unit>((IObservable <M0>) this.ClickDelete, 1, (FrameCountType)0),
                observable1,
                observable3,
                observable2,
                observable4,
                observable5,
                observable6
            }), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Action <M0>)(_ => this.RefreshUI())), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>(Observable.Where <StuffItem>((IObservable <M0>) this._recyclingUI.DecidedItemSlotUI.DeleteEvent, (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Func <M0, bool>)(_ => this.IsActiveControl)), (Func <M0, bool>)(_ => this.ItemInfo.Item5 == 1)), (Func <M0, bool>)(item => item != null)), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this.ItemInfo.Item3, (Object)null))), (Func <M0, bool>)(item => ((ItemNodeUI)this.ItemInfo.Item3).Item == item)), (Func <M0, bool>)(item => item.Count <= 0)), (Action <M0>)(_ => this.DetachItem())), (Component)this);
        }