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)));
        }
 protected override void OnBeforeStart()
 {
     base.OnBeforeStart();
     ObservableExtensions.Subscribe <bool>(Observable.TakeUntilDestroy <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Component)this), (Action <M0>)(x => this.SetActiveControl(x)));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._closeButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Func <M0, bool>)(_ => this.IsActiveControl)), (Action <M0>)(_ => this.DoClose()));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._sortButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this._sortUI.IsActiveControl = !this._sortUI.IsActiveControl));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._setButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.DoSetAudio()));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._rightButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.DoMove(1)));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._leftButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.DoMove(-1)));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._playButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.DoPlay()));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._pauseButton), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.AudioStop()));
     ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this._sortToggle), (Func <M0, bool>)(_ => this.InputEnabled)), (Action <M0>)(_ => this.ListSort()));
     if (Object.op_Inequality((Object)((Selectable)this._sortToggle).get_targetGraphic(), (Object)null))
     {
         ObservableExtensions.Subscribe <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this._sortToggle), (Action <M0>)(isOn => ((Behaviour)((Selectable)this._sortToggle).get_targetGraphic()).set_enabled(!isOn)));
     }
     this._sortUI.ToggleIndexChanged = (Action <int>)(x => this.ListSort());
     if (!Object.op_Inequality((Object)this._sortSelectedImage, (Object)null))
     {
         return;
     }
     ((Behaviour)this._sortSelectedImage).set_enabled(false);
     ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._sortToggle), (Action <M0>)(_ => ((Behaviour)this._sortSelectedImage).set_enabled(true)));
     ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._sortToggle), (Action <M0>)(_ => ((Behaviour)this._sortSelectedImage).set_enabled(false)));
 }
Beispiel #3
0
        public static CompositeDisposable BindToEnter(
            bool isExit,
            params TagSelection.ICursorTagElement[] elements)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            TagSelection.\u003CBindToEnter\u003Ec__AnonStorey4 enterCAnonStorey4_1 = new TagSelection.\u003CBindToEnter\u003Ec__AnonStorey4();
            // ISSUE: reference to a compiler-generated field
            enterCAnonStorey4_1.isExit = isExit;
            // ISSUE: reference to a compiler-generated field
            enterCAnonStorey4_1.elements = elements;
            CompositeDisposable compositeDisposable = new CompositeDisposable();

            // ISSUE: reference to a compiler-generated field
            foreach (TagSelection.ICursorTagElement element in enterCAnonStorey4_1.elements)
            {
                TagSelection.ICursorTagElement item = element;
                CursorFrame.Set(((Graphic)item.cursor).get_rectTransform(), (RectTransform)((Component)item.selectable).GetComponent <RectTransform>(), (RectTransform)null);
                DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Image>((IObservable <M0>)Observable.Select <PointerEventData, Image>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)item.selectable), (Component)item.cursor), (Func <M0, M1>)(_ => item.cursor)), (Action <M0>)(cursor =>
                {
                    // ISSUE: variable of a compiler-generated type
                    TagSelection.\u003CBindToEnter\u003Ec__AnonStorey4 enterCAnonStorey4 = enterCAnonStorey4_1;
                    Image cursor1 = cursor;
                    ((Behaviour)cursor1).set_enabled(true);
                    if (isExit)
                    {
                        return;
                    }
                    foreach (TagSelection.ICursorTagElement cursorTagElement in ((IEnumerable <TagSelection.ICursorTagElement>)elements).Where <TagSelection.ICursorTagElement>((Func <TagSelection.ICursorTagElement, bool>)(x => Object.op_Inequality((Object)x.cursor, (Object)cursor1))))
                    {
                        ((Behaviour)cursorTagElement.cursor).set_enabled(false);
                    }
                })), (ICollection <IDisposable>)compositeDisposable);
                // ISSUE: reference to a compiler-generated field
                if (enterCAnonStorey4_1.isExit)
                {
                    DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)item.selectable), (Component)item.cursor), (Action <M0>)(_ => ((Behaviour)item.cursor).set_enabled(false))), (ICollection <IDisposable>)compositeDisposable);
                }
            }
            return(compositeDisposable);
        }
Beispiel #4
0
        public static CompositeDisposable BindToEnter(
            bool isExit,
            Image cursor,
            params Selectable[] selectables)
        {
            CompositeDisposable compositeDisposable = new CompositeDisposable();

            foreach (Selectable selectable in selectables)
            {
                Selectable item = selectable;
                DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)item), (Component)cursor), (Func <M0, bool>)(_ => item.IsInteractable())), (Action <M0>)(_ =>
                {
                    ((Behaviour)cursor).set_enabled(true);
                    CursorFrame.Set(((Graphic)cursor).get_rectTransform(), (RectTransform)((Component)item).GetComponent <RectTransform>(), (RectTransform)null);
                })), (ICollection <IDisposable>)compositeDisposable);
                if (isExit)
                {
                    DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)item), (Component)cursor), (Action <M0>)(_ => ((Behaviour)cursor).set_enabled(false))), (ICollection <IDisposable>)compositeDisposable);
                }
            }
            return(compositeDisposable);
        }
Beispiel #5
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;
 }
        private void Start()
        {
            if (Object.op_Equality((Object)this._button, (Object)null))
            {
                this._button = (Button)((Component)this).GetComponent <Button>();
                if (Object.op_Equality((Object)this._button, (Object)null))
                {
                    Debug.LogError((object)"Button none", (Object)this);
                    Object.Destroy((Object)this);
                    return;
                }
            }
            if (Object.op_Equality((Object)this._tmpText, (Object)null) && Object.op_Equality((Object)this._unityText, (Object)null))
            {
                if (Object.op_Equality((Object)this._tmpText, (Object)null))
                {
                    this._tmpText = (TextMeshProUGUI)((Component)this).GetComponentInChildren <TextMeshProUGUI>();
                }
                if (Object.op_Equality((Object)this._unityText, (Object)null))
                {
                    this._unityText = (Text)((Component)this).GetComponentInChildren <Text>();
                }
                if (Object.op_Equality((Object)this._tmpText, (Object)null) && Object.op_Equality((Object)this._unityText, (Object)null))
                {
                    Debug.LogError((object)"Component Text none", (Object)this);
                    Object.Destroy((Object)this);
                    return;
                }
            }
            ColorBlock colors = ((Selectable)this._button).get_colors();
            ReactiveProperty <bool> isOnUI    = new ReactiveProperty <bool>(false);
            ReactiveProperty <bool> isPressUI = new ReactiveProperty <bool>(false);

            ObservableExtensions.Subscribe <bool>((IObservable <M0>)isOnUI, (Action <M0>)(isOn =>
            {
                if (isOn)
                {
                    if (isPressUI.get_Value())
                    {
                        this.SetColor(((ColorBlock) ref colors).get_pressedColor());
                    }
                    else
                    {
                        this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
                    }
                }
                else if (isPressUI.get_Value())
                {
                    this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
                }
                else
                {
                    this.SetColor(((ColorBlock) ref colors).get_normalColor());
                }
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>)isPressUI, (Action <M0>)(isOn =>
            {
                if (isOn)
                {
                    this.SetColor(((ColorBlock) ref colors).get_pressedColor());
                }
                else if (isOnUI.get_Value())
                {
                    this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
                }
                else
                {
                    this.SetColor(((ColorBlock) ref colors).get_normalColor());
                }
            }));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)this._button), (Action <M0>)(_ => isPressUI.set_Value(true)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)this._button), (Action <M0>)(_ => isPressUI.set_Value(false)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._button), (Action <M0>)(_ => isOnUI.set_Value(true)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._button), (Action <M0>)(_ => isOnUI.set_Value(false)));
        }
 private void Start()
 {
     if (!Object.op_Inequality((Object)this._button, (Object)null))
     {
         return;
     }
     ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._button), (Func <M0, bool>)(_ => ((Selectable)this._button).IsInteractable())), (Action <M0>)(_ =>
     {
         this._entered = true;
         this.Easing(true, this._focusDuration);
     }));
     ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._button), (Func <M0, bool>)(_ => ((Selectable)this._button).IsInteractable())), (Action <M0>)(_ =>
     {
         this._entered = false;
         this.Easing(false, this._focusDuration);
     }));
     ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)this._button), (Func <M0, bool>)(_ => ((Selectable)this._button).IsInteractable() && this._entered)), (Action <M0>)(_ => this.Easing(false, this._clickDuration)));
     ObservableExtensions.Subscribe <PointerEventData>(Observable.Where <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)this._button), (Func <M0, bool>)(_ => ((Selectable)this._button).IsInteractable() && this._entered)), (Action <M0>)(_ => this.Easing(true, this._clickDuration)));
 }
Beispiel #8
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);
 }
 public override void Init(UICtrl _uiCtrl, bool _tutorial)
 {
     base.Init(_uiCtrl, _tutorial);
     foreach (KeyValuePair <int, Manager.Housing.CategoryInfo> keyValuePair in Singleton <Manager.Housing> .Instance.dicCategoryInfo)
     {
         GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.objCategory, this.togglesRoot);
         gameObject.SetActive(true);
         TabUI tab = (TabUI)gameObject.GetComponent <TabUI>();
         tab.rawImage.set_texture((Texture)keyValuePair.Value.Thumbnail);
         Toggle toggleSelect = tab.toggleSelect;
         toggleSelect.set_isOn(false);
         int c = keyValuePair.Key;
         ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(toggleSelect), (Func <M0, bool>)(_b => _b)), (Action <M0>)(_ => this.Category = c));
         DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)toggleSelect), (Component)tab.imageCursor), (Action <M0>)(_ => ((Behaviour)tab.imageCursor).set_enabled(true))), gameObject);
         DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <PointerEventData>(Observable.TakeUntilDestroy <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)toggleSelect), (Component)tab.imageCursor), (Action <M0>)(_ => ((Behaviour)tab.imageCursor).set_enabled(false))), gameObject);
     }
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable((Button)this.buttonClose), (Action <M0>)(_ => this.Active = false));
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAdd), (Action <M0>)(_ =>
     {
         AddUICtrl.FileInfo fileInfo = this.fileInfos.SafeGet <AddUICtrl.FileInfo>(this.Select);
         if (fileInfo != null)
         {
             Singleton <UndoRedoManager> .Instance.Do((ICommand) new AddItemCommand(fileInfo.no));
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_L);
         }
         this.Active = false;
     }));
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonActivate), (Action <M0>)(_ =>
     {
         ConfirmScene.Sentence     = "作成しますか";
         ConfirmScene.OnClickedYes = (Action)(() =>
         {
             AddUICtrl.FileInfo fileInfo = this.fileInfos.SafeGet <AddUICtrl.FileInfo>(this.Select);
             if (fileInfo == null)
             {
                 return;
             }
             fileInfo.SetUnlock();
             this.Visible = true;
             ((ReactiveProperty <int>) this.selectReactive).SetValueAndForceNotify(this.Select);
             this.view.RefreshAllShownItem();
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Craft);
         });
         ConfirmScene.OnClickedNo = (Action)(() => this.Visible = true);
         Singleton <Game> .Instance.LoadDialog();
         this.Visible = false;
     }));
     ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.activeReactive, (Action <M0>)(_b =>
     {
         this.Visible = _b;
         if (!_b)
         {
             return;
         }
         this.isForceUpdate = true;
         ((ReactiveProperty <int>) this.selectReactive).SetValueAndForceNotify(-1);
         this.buttonClose.ClearState();
     }));
     ObservableExtensions.Subscribe <int>((IObservable <M0>) this.categoryReactive, (Action <M0>)(_i =>
     {
         this.CreateList(_i);
         Manager.Housing.CategoryInfo categoryInfo = (Manager.Housing.CategoryInfo)null;
         if (Singleton <Manager.Housing> .Instance.dicCategoryInfo.TryGetValue(_i, out categoryInfo))
         {
             this.textCategory.set_text(categoryInfo.name);
             this.imageCategory.set_texture((Texture)categoryInfo.Thumbnail);
         }
         else
         {
             Debug.LogErrorFormat("存在しないカテゴリー[{0}]", new object[1]
             {
                 (object)_i
             });
         }
     }));
     ObservableExtensions.Subscribe <int>((IObservable <M0>) this.selectReactive, (Action <M0>)(_i =>
     {
         AddUICtrl.FileInfo fileInfo = this.fileInfos.SafeGet <AddUICtrl.FileInfo>(_i);
         if (fileInfo != null)
         {
             if (fileInfo.Unlock)
             {
                 this.cgCraft.Enable(false, false);
                 bool flag            = !Singleton <Manager.Housing> .Instance.CheckLimitNum(fileInfo.no);
                 this.ButtonAddEnable = !flag;
                 ((Behaviour)this.textItemLimit).set_enabled(flag);
             }
             else
             {
                 this.cgCraft.Enable(true, false);
                 ((Selectable)this.buttonActivate).set_interactable(this.materialUI.UpdateUI(fileInfo.loadInfo));
                 this.ButtonAddEnable = false;
                 ((Behaviour)this.textItemLimit).set_enabled(false);
             }
             this.textName.set_text(fileInfo.loadInfo.name);
             this.textText.set_text(fileInfo.loadInfo.text);
             ((Behaviour)this.imagesInfo[0]).set_enabled(fileInfo.loadInfo.isAccess);
             ((Behaviour)this.imagesInfo[1]).set_enabled(fileInfo.loadInfo.isAction);
             ((Behaviour)this.imagesInfo[2]).set_enabled(fileInfo.loadInfo.isHPoint);
             this.cgInfo.Enable(true, false);
         }
         else
         {
             this.cgInfo.Enable(false, false);
             this.cgCraft.Enable(false, false);
             this.ButtonAddEnable = false;
             ((Behaviour)this.textItemLimit).set_enabled(false);
             if (!this.isForceUpdate)
             {
                 return;
             }
             this.view.RefreshAllShownItem();
             this.isForceUpdate = false;
         }
     }));
     ((ReactiveProperty <int>) this.categoryReactive).SetValueAndForceNotify(-1);
 }
Beispiel #10
0
        private void Start()
        {
            if (Object.op_Equality((Object)this._toggle, (Object)null))
            {
                this._toggle = (Toggle)((Component)this).GetComponent <Toggle>();
                if (Object.op_Equality((Object)this._toggle, (Object)null))
                {
                    Debug.LogError((object)"Toggle none", (Object)this);
                    Object.Destroy((Object)this);
                    return;
                }
            }
            if (Object.op_Equality((Object)this._tmpText, (Object)null) && Object.op_Equality((Object)this._unityText, (Object)null))
            {
                if (Object.op_Equality((Object)this._tmpText, (Object)null))
                {
                    this._tmpText = (TextMeshProUGUI)((Component)this).GetComponentInChildren <TextMeshProUGUI>();
                }
                if (Object.op_Equality((Object)this._unityText, (Object)null))
                {
                    this._unityText = (Text)((Component)this).GetComponentInChildren <Text>();
                }
                if (Object.op_Equality((Object)this._tmpText, (Object)null) && Object.op_Equality((Object)this._unityText, (Object)null))
                {
                    Debug.LogError((object)"Component Text none", (Object)this);
                    Object.Destroy((Object)this);
                    return;
                }
            }
            ColorBlock colors = ((Selectable)this._toggle).get_colors();
            ReactiveProperty <bool> isOnUI    = new ReactiveProperty <bool>(false);
            ReactiveProperty <bool> isPressUI = new ReactiveProperty <bool>(false);

            ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)isOnUI, (Func <M0, bool>)(_ => !this._toggle.get_isOn())), (Action <M0>)(isOn =>
            {
                if (isOn)
                {
                    if (isPressUI.get_Value())
                    {
                        return;
                    }
                    this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
                }
                else
                {
                    if (!isPressUI.get_Value())
                    {
                        return;
                    }
                    this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
                }
            }));
            ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)isPressUI, (Func <M0, bool>)(_ => !this._toggle.get_isOn())), (Action <M0>)(isOn =>
            {
                if (isOn || !isOnUI.get_Value())
                {
                    return;
                }
                this.SetColor(((ColorBlock) ref colors).get_highlightedColor());
            }));
            ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)Observable.CombineLatest <bool, bool, bool>((IObservable <M0>)isPressUI, (IObservable <M1>)isOnUI, (Func <M0, M1, M2>)((x, y) => x && y)), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(_ =>
            {
                if (this._toggle.get_isOn())
                {
                    return;
                }
                this.SetColor(((ColorBlock) ref colors).get_pressedColor());
            }));
            ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)Observable.CombineLatest <bool, bool, bool>((IObservable <M0>)isPressUI, (IObservable <M1>)isOnUI, (Func <M0, M1, M2>)((x, y) => !x && !y)), (Func <M0, bool>)(isOut => isOut)), (Action <M0>)(_ =>
            {
                if (this._toggle.get_isOn())
                {
                    this.SetColor(((ColorBlock) ref colors).get_pressedColor());
                }
                else
                {
                    this.SetColor(((ColorBlock) ref colors).get_normalColor());
                }
            }));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)this._toggle), (Action <M0>)(_ => isPressUI.set_Value(true)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)this._toggle), (Action <M0>)(_ => isPressUI.set_Value(false)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this._toggle), (Action <M0>)(_ => isOnUI.set_Value(true)));
            ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerExitAsObservable((UIBehaviour)this._toggle), (Action <M0>)(_ => isOnUI.set_Value(false)));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this._toggle), (Action <M0>)(isOn =>
            {
                if (isOn)
                {
                    this.SetColor(((ColorBlock) ref colors).get_pressedColor());
                }
                else
                {
                    this.SetColor(((ColorBlock) ref colors).get_normalColor());
                }
            }));
        }