Exemplo n.º 1
0
        protected override void Start()
        {
            base.Start();
            if (Object.op_Inequality((Object)this._infoLayout, (Object)null))
            {
                this._infoLayout.SetActive(true);
            }
            ((ReactiveProperty <bool>) this._active).set_Value(this.isOpen);
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._active, (Action <M0>)(active => this.isCountViewerVisible = active));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._active, (Action <M0>)(active => ((Component)this._submitButton).get_gameObject().SetActive(active)));
            UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._createSum, this._itemName, (Func <M0, string>)(i =>
            {
                string str = string.Empty;
                if (i > 0)
                {
                    str = string.Format(" x {0}", (object)i);
                }
                string itemName = this.itemName;
                if (itemName.IsNullOrEmpty())
                {
                    str = string.Empty;
                }
                return(string.Format("{0}{1}", (object)itemName, (object)str));
            }));
            this._storageDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <CancellationToken, IEnumerator>)(_ => this.LoadStorageType()), false));
            Text  text          = (Text)((Component)this._submitButton).GetComponentInChildren <Text>();
            Color baseTextColor = ((Graphic)text).get_color();

            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._submitButton), (Action <M0>)(_ => ((Graphic)text).set_color(Define.Get(Colors.Orange))));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._submitButton), (Action <M0>)(_ => ((Graphic)text).set_color(baseTextColor)));
        }
Exemplo n.º 2
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;
     }));
 }
Exemplo n.º 3
0
        protected virtual void Start()
        {
            if (Object.op_Inequality((Object)this._nameLabel, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._name, this._nameLabel);
            }
            if (Object.op_Inequality((Object)this._stackCountText, (Object)null))
            {
                int itemSlotMax = Singleton <Resources> .Instance.DefinePack.MapDefines.ItemSlotMax;
                UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._stackCount, this._stackCountText, (Func <M0, string>)(i =>
                {
                    if (i < 0)
                    {
                        return(string.Empty);
                    }
                    return(i <= itemSlotMax ? string.Format("{0}", (object)i) : string.Format("{0}+", (object)itemSlotMax));
                }));
            }
            EasingFunction easing;

            if (!Tween.MotionFunctionTable.TryGetValue(this._motionType, ref easing))
            {
                ;
            }
            if (!Tween.MotionFunctionTable.TryGetValue(this._alphaMotionType, ref easing))
            {
                return;
            }
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Create(easing, this._easingDuration, true), true), (System.Action <M0>)(x => this._canvasGroup.set_alpha(Mathf.Lerp(this._fromAlpha, this._toAlpha, ((TimeInterval <float>) ref x).get_Value())))), (ICollection <IDisposable>) this.disposables);
        }
 public void Initialize()
 {
     if (this.initialized)
     {
         return;
     }
     if (Object.op_Inequality((Object)this._yText, (Object)null))
     {
         DisposableExtensions.AddTo <IDisposable>((M0)UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._y, this._yText), (Component)this._yText);
         DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <int>((IObservable <M0>) this._y, (Action <M0>)(_ => this.Refresh())), (Component)this._yText);
     }
     if (Object.op_Inequality((Object)this._xText, (Object)null))
     {
         DisposableExtensions.AddTo <IDisposable>((M0)UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._x, this._xText), (Component)this._xText);
     }
     this.VisibleUpdate();
     this.initialized = true;
 }
Exemplo n.º 5
0
        protected virtual void Start()
        {
            if (Object.op_Inequality((Object)this._nameLabel, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._name, this._nameLabel);
            }
            if (Object.op_Inequality((Object)this._stackCountText, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._stackCount, this._stackCountText);
            }
            if (Object.op_Inequality((Object)this._rateText, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText <int>((IObservable <M0>) this._rate, this._rateText, (Func <M0, string>)(x => x >= 0 ? x.ToString() : string.Empty));
            }
            if (Object.op_Inequality((Object)this._iconText, (Object)null))
            {
                ((Behaviour)this._iconText).set_enabled(false);
            }
            if (Object.op_Inequality((Object)this._rarelityText, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText <Rarelity>((IObservable <M0>) this._rarelity, this._rarelityText, (Func <M0, string>)(x => x.GetType().IsEnumDefined((object)x) ? x.ToString() : string.Empty));
                ObservableExtensions.Subscribe <Sprite>((IObservable <M0>) this._rarelitySprite, (System.Action <M0>)(sprite => ((Behaviour)this._rarelityText).set_enabled(Object.op_Equality((Object)sprite, (Object)null))));
            }
            if (Object.op_Inequality((Object)this._rarelityImage, (Object)null))
            {
                ObservableExtensions.Subscribe <Sprite>((IObservable <M0>) this._rarelitySprite, (System.Action <M0>)(sprite =>
                {
                    ((Behaviour)this._rarelityImage).set_enabled(!Object.op_Equality((Object)sprite, (Object)null));
                    this._rarelityImage.set_sprite(sprite);
                }));
            }
            EasingFunction easing;

            if (!Tween.MotionFunctionTable.TryGetValue(this._motionType, ref easing))
            {
                ;
            }
            if (!Tween.MotionFunctionTable.TryGetValue(this._alphaMotionType, ref easing))
            {
                return;
            }
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Create(easing, this._easingDuration, true), true), (System.Action <M0>)(x => this._canvasGroup.set_alpha(Mathf.Lerp(this._fromAlpha, this._toAlpha, ((TimeInterval <float>) ref x).get_Value())))), (ICollection <IDisposable>) this.disposables);
        }
        protected virtual void Start()
        {
            if (Object.op_Inequality((Object)this._nameLabel, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._name, this._nameLabel);
            }
            if (Object.op_Inequality((Object)this._successLabel, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToInteractable((IObservable <bool>) this._isSuccess, (Selectable)this._button);
                UnityUIComponentExtensions.SubscribeToText <bool>((IObservable <M0>) this._isSuccess, this._successLabel, (Func <M0, string>)(success => success ? "OK!" : string.Empty));
                ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._isSuccess, (System.Action <M0>)(success => ((Graphic)this._successLabel).set_color(Define.Get(!success ? Colors.White : Colors.Blue))));
            }
            EasingFunction easing;

            if (!Tween.MotionFunctionTable.TryGetValue(this._motionType, ref easing))
            {
                ;
            }
            if (!Tween.MotionFunctionTable.TryGetValue(this._alphaMotionType, ref easing))
            {
                return;
            }
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Create(easing, this._easingDuration, true), true), (System.Action <M0>)(x => this._canvasGroup.set_alpha(Mathf.Lerp(this._fromAlpha, this._toAlpha, ((TimeInterval <float>) ref x).get_Value())))), (ICollection <IDisposable>) this.disposables);
        }
        protected virtual void Start()
        {
            if (Object.op_Inequality((Object)this._nameLabel, (Object)null))
            {
                UnityUIComponentExtensions.SubscribeToText((IObservable <string>) this._name, this._nameLabel);
            }
            this._slotCounter.Initialize();
            if (!Object.op_Inequality((Object)this._slotCounter.xText, (Object)null))
            {
                return;
            }
            IObservable <M1> observable = Observable.Select <int, Colors>((IObservable <M0>) this._slotCounter.X, (Func <M0, M1>)(i => i < this._slotCounter.y ? Colors.Red : Colors.White));

            // ISSUE: reference to a compiler-generated field
            if (RecipeItemNodeUI.\u003C\u003Ef__mg\u0024cache0 == null)
            {
                // ISSUE: reference to a compiler-generated field
                RecipeItemNodeUI.\u003C\u003Ef__mg\u0024cache0 = new Func <Colors, Color>(Define.Get);
            }
            // ISSUE: reference to a compiler-generated field
            Func <Colors, Color> fMgCache0 = RecipeItemNodeUI.\u003C\u003Ef__mg\u0024cache0;

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Color>((IObservable <M0>)Observable.Select <Colors, Color>((IObservable <M0>)observable, (Func <M0, M1>)fMgCache0), (Action <M0>)(color => ((Graphic)this._slotCounter.xText).set_color(color))), (Component)this._slotCounter.xText);
        }