コード例 #1
0
 private void Start()
 {
     ObservableExtensions.Subscribe <int>(Observable.Where <int>((IObservable <M0>) this.SelectedID, (Func <M0, bool>)(x => x >= 0 && x < this.lstCoordinates.Count)), (Action <M0>)(x =>
     {
         for (int index = 0; index < this.lstCoordinates.Count; ++index)
         {
             if (this.lstCoordinates[index].id == x)
             {
                 this.SelectedLabel.set_text(this.lstCoordinates[index].coodeName.get_text());
                 this.filename = this.lstCoordinates[index].fileName;
                 this.CardImage.set_texture((Texture)PngAssist.ChangeTextureFromByte(this.lstCoordinatesBase[x].pngData == null ? PngFile.LoadPngBytes(this.lstCoordinatesBase[x].FullPath) : this.lstCoordinatesBase[x].pngData, 0, 0, (TextureFormat)5, false));
             }
         }
         if (!((Component)this.CardImage).get_gameObject().get_activeSelf())
         {
             ((Component)this.CardImage).get_gameObject().SetActive(true);
         }
         for (int index = 0; index < this.lstCoordinates.Count; ++index)
         {
             if (this.lstCoordinates[index].id != x)
             {
                 ((Graphic)this.lstCoordinates[index].image).set_color(Color.get_white());
             }
             else
             {
                 ((Graphic)this.lstCoordinates[index].image).set_color(Define.Get(Colors.Yellow));
             }
         }
     }));
 }
コード例 #2
0
        public void RefreshCountText()
        {
            int num = this.ItemCount();

            this._countText.set_text(num.ToString());
            ((Graphic)this._countText).set_color(Define.Get(this.SlotMaxNum > num ? Colors.White : Colors.Red));
        }
コード例 #3
0
        public void RefreshCountText()
        {
            this._maxCountText.set_text(string.Format("{0}", (object)this.ItemSlotMax));
            int count = this.ItemList.Count;

            this._countText.set_text(string.Format("{0}", (object)count));
            ((Graphic)this._countText).set_color(Define.Get(count >= this.ItemSlotMax ? Colors.Red : Colors.White));
        }
コード例 #4
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._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);
        }
コード例 #5
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)));
        }
コード例 #6
0
        protected override void Start()
        {
            if (!Application.get_isPlaying())
            {
                return;
            }
            this._toggles = (Toggle[])((Component)this).GetComponentsInChildren <Toggle>(true);
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this._isOpen, (Action <M0>)(isOn =>
            {
                if (!isOn)
                {
                    ((ReactiveProperty <int>) this._selectedID).set_Value(-1);
                    this.playSE.Play(SoundPack.SystemSE.Cancel);
                }
                this.OpenCloseAnimation(isOn);
            }));
            ObservableExtensions.Subscribe <int>((IObservable <M0>) this._selectedID, (Action <M0>)(x =>
            {
                Toggle element = this._toggles.GetElement <Toggle>(x);
                if (Object.op_Equality((Object)element, (Object)null))
                {
                    this._selectedOptionInstance = (Toggle)null;
                }
                else
                {
                    this._selectedOptionInstance = element;
                }
            }));
            this.cursorCG.set_alpha(1f);
            ((Behaviour)this._cursor).set_enabled(false);
            ColorBlock colors = ((Selectable)this._close).get_colors();

            ((ColorBlock) ref colors).set_highlightedColor(Define.Get(Colors.Green));
            ((Selectable)this._close).set_colors(colors);
            DisposableExtensions.AddTo <CompositeDisposable>((M0)((IEnumerable <Selectable>) this._toggles).BindToEnter(true, this._cursor), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)((IEnumerable <Toggle>) this._toggles).BindToGroup((Action <int>)(type => ((ReactiveProperty <int>) this._sortType).set_Value(type))), (Component)this);
            ObservableExtensions.Subscribe <int>((IObservable <M0>) this._sortType, (Action <M0>)(type =>
            {
                if (this.TypeChanged != null)
                {
                    this.TypeChanged(type);
                }
                this.playSE.Play(SoundPack.SystemSE.OK_S);
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._close), (Action <M0>)(_ => this.OnInputCancel()));
            Image component = (Image)((Component)this).GetComponent <Image>();

            if (Object.op_Inequality((Object)component, (Object)null))
            {
                ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)component), (Func <M0, bool>)(_ => ((ReactiveProperty <bool>) this._isOpen).get_Value())), (Action <M0>)(_ =>
                {
                    if (this.OnEntered == null)
                    {
                        return;
                    }
                    this.OnEntered();
                }));
            }
            // ISSUE: object of a compiler-generated type is created
            using (IEnumerator <\u003C\u003E__AnonType23 <Selectable, int> > enumerator = ((IEnumerable <Selectable>) new Selectable[1]
            {
                (Selectable)this._close
            }).Concat <Selectable>((IEnumerable <Selectable>) this._toggles).Select <Selectable, \u003C\u003E__AnonType23 <Selectable, int> >((Func <Selectable, int, \u003C\u003E__AnonType23 <Selectable, int> >)((o, index) => new \u003C\u003E__AnonType23 <Selectable, int>(o, index - 1))).GetEnumerator())
            {
                while (((IEnumerator)enumerator).MoveNext())
                {
                    // ISSUE: variable of a compiler-generated type
                    \u003C\u003E__AnonType23 <Selectable, int> item = enumerator.Current;
                    ItemSortUI itemSortUi = this;
                    ObservableExtensions.Subscribe <int>((IObservable <M0>)Observable.Select <PointerEventData, int>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)item.o), (Func <M0, M1>)(_ => item.index)), (Action <M0>)(index =>
                    {
                        ((ReactiveProperty <int>)itemSortUi._selectedID).set_Value(index);
                        if (itemSortUi.OnEntered == null)
                        {
                            return;
                        }
                        itemSortUi.OnEntered();
                    }));
                }
            }
            ActionIDDownCommand actionIdDownCommand1 = new ActionIDDownCommand()
            {
                ActionID = ActionID.Submit
            };

            // ISSUE: method pointer
            actionIdDownCommand1.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__B)));
            this._actionCommands.Add(actionIdDownCommand1);
            ActionIDDownCommand actionIdDownCommand2 = new ActionIDDownCommand()
            {
                ActionID = ActionID.Cancel
            };

            // ISSUE: method pointer
            actionIdDownCommand2.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__C)));
            this._actionCommands.Add(actionIdDownCommand2);
            ActionIDDownCommand actionIdDownCommand3 = new ActionIDDownCommand()
            {
                ActionID = ActionID.MouseRight
            };

            // ISSUE: method pointer
            actionIdDownCommand3.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__D)));
            this._actionCommands.Add(actionIdDownCommand3);
            base.Start();
            this.playSE.use = true;
        }