Beispiel #1
0
 public static IObservable <System.Reactive.Unit> Throw(
     this IObservable <System.Runtime.ExceptionServices.ExceptionDispatchInfo> ExceptionDispatchInfoValue)
 {
     return
         (Observable.Do(ExceptionDispatchInfoValue,
                        (ExceptionDispatchInfoValueLambda) => ExceptionDispatchInfoValueLambda.Throw()).ToUnit());
 }
        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);
        }
Beispiel #3
0
        public void Do_ArgumentChecking()
        {
            var someObservable = Observable.Empty <int>();

            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, (Action <int>)null));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do <int>(null, _ => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, x => { }, (Action)null));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, null, () => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do <int>(null, x => { }, () => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, x => { }, (Action <Exception>)null));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, null, (Exception _) => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do <int>(null, x => { }, (Exception _) => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, x => { }, (Exception _) => { }, null));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, x => { }, null, () => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, null, (Exception _) => { }, () => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do <int>(null, x => { }, (Exception _) => { }, () => { }));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(null, Observer.Create <int>(i => { })));
            ReactiveAssert.Throws <ArgumentNullException>(() => Observable.Do(someObservable, default(IObserver <int>)));
        }
 protected virtual void Start()
 {
     base.Start();
     this.ListController.RefreshEvent += (Action)(() => this.RefreshUI());
     if (this._updateDisposable != null)
     {
         this._updateDisposable.Clear();
     }
     this._updateDisposable = new CompositeDisposable();
     if (Singleton <Resources> .IsInstance())
     {
         DefinePack.RecyclingSetting recycling = Singleton <Resources> .Instance.DefinePack.Recycling;
         this.CountLimit            = recycling.ItemCreateTime;
         this.SlotMaxNum            = recycling.DecidedItemCapacity;
         this.CreatedItemSlotMaxNum = recycling.CreateItemCapacity;
         this.NeedNumber            = recycling.NeedNumber;
     }
     else
     {
         this.CountLimit            = 0.0f;
         this.SlotMaxNum            = 0;
         this.CreatedItemSlotMaxNum = 0;
         this.NeedNumber            = 0;
     }
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), ((Component)this).get_gameObject()), (Action <M0>)(_ => this.OnRecyclingDataUpdate())), (ICollection <IDisposable>) this._updateDisposable);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.Merge <Unit>((IObservable <M0>[]) new IObservable <Unit>[2]
     {
         (IObservable <Unit>)Observable.Do <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._createButton), (Action <M0>)(_ => this.OnStartClick())),
         (IObservable <Unit>)Observable.Do <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._cancelButton), (Action <M0>)(_ => this.OnCancelClick()))
     }), (Action <M0>)(_ => this._recyclingUI.PlaySE(SoundPack.SystemSE.OK_S))), (Component)this);
     this._recyclingUI.CreateItemStockUI.ChangeCreateableEvent += (Action <bool>)(flag => ((Selectable)this._createButton).set_interactable(flag));
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.IsCreate, (Action <M0>)(flag =>
     {
         this.SetActive((Component)this._cancelButton, flag);
         this.SetActive((Component)this._createButton, !flag);
         this.SetActive((Component)this._playNowText, flag);
     })), (ICollection <IDisposable>) this._updateDisposable);
 }
        protected virtual void Start()
        {
            base.Start();
            this.ItemSlotMax = !Singleton <Resources> .IsInstance() ? 0 : Singleton <Resources> .Instance.DefinePack.Recycling.CreateItemCapacity;

            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._deleteSubmitButton), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ =>
            {
                this.OnDeleteOKClick();
                this._recyclingUI.PlaySE(SoundPack.SystemSE.OK_L);
            })), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._deleteCancelButton), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ =>
            {
                this.OnDeleteCancelClick();
                this._recyclingUI.PlaySE(SoundPack.SystemSE.Cancel);
            })), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.Merge <Unit>((IObservable <M0>[]) new IObservable <Unit>[2]
            {
                (IObservable <Unit>)Observable.Do <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._oneGetButton), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.OnClickOneGet())),
                (IObservable <Unit>)Observable.Do <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this._allGetButton), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.OnClickAllGet()))
            }), (Action <M0>)(_ => this._recyclingUI.PlaySE(SoundPack.SystemSE.OK_S))), (Component)this);
            this.ListController.RefreshEvent += (Action)(() => this.RefreshUI());
            this._itemListUI.CurrentChanged  += (Action <int, ItemNodeUI>)((currentID, nodeUI) => this.RefreshOneGetButtonInteractable(nodeUI));
        }
        public void SetActiveTimer(bool active)
        {
            if (Object.op_Equality((Object)this._timerText, (Object)null) || Object.op_Equality((Object)this._timerCanvasGroup, (Object)null) || this.ActiveTimer == active)
            {
                return;
            }
            this.ActiveTimer = active;
            if (this._timerDisposable != null)
            {
                this._timerDisposable.Dispose();
            }
            float startAlpha = this._timerCanvasGroup.get_alpha();
            int   destAlpha  = !active ? 0 : 1;

            ObservableExtensions.Subscribe <TimeInterval <float> >(Observable.DoOnError <TimeInterval <float> >(Observable.Do <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Linear(0.3f, true), true), (Action <M0>)(x => this._timerCanvasGroup.set_alpha(Mathf.Lerp(startAlpha, (float)destAlpha, ((TimeInterval <float>) ref x).get_Value())))), (Action <Exception>)(ex => Debug.LogException(ex))));
        }
Beispiel #7
0
 private void Start()
 {
     ObservableExtensions.Subscribe <long>(Observable.OnErrorRetry <long>(Observable.Do <long>(Observable.Where <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), (Component)this), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.OnUpdate()), (Action <Exception>)(ex => Debug.LogException(ex)))), (Action <M0>)(_ => {}));
 }
Beispiel #8
0
        public void Initialize(int _slotNo, int _correctNo)
        {
            this.slotNo    = _slotNo;
            this.correctNo = _correctNo;
            if (this.slotNo == -1 || this.correctNo == -1)
            {
                return;
            }
            if (Object.op_Implicit((Object)this.title))
            {
                this.title.set_text(string.Format("{0}{1:00}", (object)"調整", (object)(this.correctNo + 1)));
            }
            this.UpdateCustomUI();
            if (this.lstDisposable != null && this.lstDisposable.Count != 0)
            {
                int count = this.lstDisposable.Count;
                for (int index = 0; index < count; ++index)
                {
                    this.lstDisposable[index].Dispose();
                }
            }
            IDisposable disposable = (IDisposable)null;

            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Toggle>) this.tglPosRate).Select <Toggle, \u003C\u003E__AnonType12 <Toggle, byte> >((Func <Toggle, int, \u003C\u003E__AnonType12 <Toggle, byte> >)((p, i) => new \u003C\u003E__AnonType12 <Toggle, byte>(p, (byte)i))).ToList <\u003C\u003E__AnonType12 <Toggle, byte> >().ForEach((Action <\u003C\u003E__AnonType12 <Toggle, byte> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(p.toggle), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(_ => this.acsCtrlSetting.correctSetting[this.correctNo].posRate = (int)p.index));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Toggle>) this.tglRotRate).Select <Toggle, \u003C\u003E__AnonType12 <Toggle, byte> >((Func <Toggle, int, \u003C\u003E__AnonType12 <Toggle, byte> >)((p, i) => new \u003C\u003E__AnonType12 <Toggle, byte>(p, (byte)i))).ToList <\u003C\u003E__AnonType12 <Toggle, byte> >().ForEach((Action <\u003C\u003E__AnonType12 <Toggle, byte> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(p.toggle), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(_ => this.acsCtrlSetting.correctSetting[this.correctNo].rotRate = (int)p.index));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Toggle>) this.tglSclRate).Select <Toggle, \u003C\u003E__AnonType12 <Toggle, byte> >((Func <Toggle, int, \u003C\u003E__AnonType12 <Toggle, byte> >)((p, i) => new \u003C\u003E__AnonType12 <Toggle, byte>(p, (byte)i))).ToList <\u003C\u003E__AnonType12 <Toggle, byte> >().ForEach((Action <\u003C\u003E__AnonType12 <Toggle, byte> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(p.toggle), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(_ => this.acsCtrlSetting.correctSetting[this.correctNo].sclRate = (int)p.index));
                this.lstDisposable.Add(disposable);
            }));
            float downTimeCnt = 0.0f;
            float loopTimeCnt = 0.0f;
            bool  change      = false;

            int[] flag = new int[3] {
                1, 2, 4
            };
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnPos).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    if (change)
                    {
                        return;
                    }
                    int index = p.index / 2;
                    int num   = p.index % 2 != 0 ? 1 : -1;
                    if (index == 0)
                    {
                        num *= -1;
                    }
                    this.chaCtrl.SetAccessoryPos(this.slotNo, this.correctNo, (float)num * this.movePosValue[this.acsCtrlSetting.correctSetting[this.correctNo].posRate], true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 0] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 0];
                    this.inpPos[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 0)).get_Item(index).ToString());
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
                disposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.RepeatUntilDestroy <Unit>(Observable.TakeUntil <Unit, PointerEventData>(Observable.SkipUntil <Unit, PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)p.btn), (IObservable <M1>)Observable.Do <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)p.btn), (Action <M0>)(_ =>
                {
                    downTimeCnt = 0.0f;
                    loopTimeCnt = 0.0f;
                    change      = false;
                }))), (IObservable <M1>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)p.btn)), (Component)this), (Action <M0>)(_ =>
                {
                    int index = p.index / 2;
                    int num1  = p.index % 2 != 0 ? 1 : -1;
                    if (index == 0)
                    {
                        num1 *= -1;
                    }
                    float num2   = (float)num1 * this.movePosValue[this.acsCtrlSetting.correctSetting[this.correctNo].posRate];
                    float num3   = 0.0f;
                    downTimeCnt += Time.get_deltaTime();
                    if ((double)downTimeCnt <= 0.300000011920929)
                    {
                        return;
                    }
                    for (loopTimeCnt += Time.get_deltaTime(); (double)loopTimeCnt > 0.0500000007450581; loopTimeCnt -= 0.05f)
                    {
                        num3 += num2;
                    }
                    if ((double)num3 == 0.0)
                    {
                        return;
                    }
                    this.chaCtrl.SetAccessoryPos(this.slotNo, this.correctNo, num3, true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 0] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 0];
                    this.inpPos[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 0)).get_Item(index).ToString());
                    change = true;
                    this.SetControllerTransform();
                })), (Component)this);
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <InputField>) this.inpPos).Select <InputField, \u003C\u003E__AnonType14 <InputField, int> >((Func <InputField, int, \u003C\u003E__AnonType14 <InputField, int> >)((p, i) => new \u003C\u003E__AnonType14 <InputField, int>(p, i))).ToList <\u003C\u003E__AnonType14 <InputField, int> >().ForEach((Action <\u003C\u003E__AnonType14 <InputField, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <string>(UnityEventExtensions.AsObservable <string>((UnityEvent <M0>)p.inp.get_onEndEdit()), (Action <M0>)(value =>
                {
                    int index = p.index % 3;
                    float num = CustomBase.ConvertValueFromTextLimit(-100f, 100f, 1, value);
                    p.inp.set_text(num.ToString());
                    this.chaCtrl.SetAccessoryPos(this.slotNo, this.correctNo, num, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 0] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 0];
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnPosReset).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    this.inpPos[p.index].set_text("0");
                    this.chaCtrl.SetAccessoryPos(this.slotNo, this.correctNo, 0.0f, false, flag[p.index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 0] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 0];
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnRot).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    if (change)
                    {
                        return;
                    }
                    int index = p.index / 2;
                    this.chaCtrl.SetAccessoryRot(this.slotNo, this.correctNo, (p.index % 2 != 0 ? 1f : -1f) * this.moveRotValue[this.acsCtrlSetting.correctSetting[this.correctNo].rotRate], true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 1] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 1];
                    this.inpRot[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 1)).get_Item(index).ToString());
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
                disposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.RepeatUntilDestroy <Unit>(Observable.TakeUntil <Unit, PointerEventData>(Observable.SkipUntil <Unit, PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)p.btn), (IObservable <M1>)Observable.Do <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)p.btn), (Action <M0>)(_ =>
                {
                    downTimeCnt = 0.0f;
                    loopTimeCnt = 0.0f;
                    change      = false;
                }))), (IObservable <M1>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)p.btn)), (Component)this), (Action <M0>)(_ =>
                {
                    int index    = p.index / 2;
                    float num1   = (p.index % 2 != 0 ? 1f : -1f) * this.moveRotValue[this.acsCtrlSetting.correctSetting[this.correctNo].rotRate];
                    float num2   = 0.0f;
                    downTimeCnt += Time.get_deltaTime();
                    if ((double)downTimeCnt <= 0.300000011920929)
                    {
                        return;
                    }
                    for (loopTimeCnt += Time.get_deltaTime(); (double)loopTimeCnt > 0.0500000007450581; loopTimeCnt -= 0.05f)
                    {
                        num2 += num1;
                    }
                    if ((double)num2 == 0.0)
                    {
                        return;
                    }
                    this.chaCtrl.SetAccessoryRot(this.slotNo, this.correctNo, num2, true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 1] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 1];
                    this.inpRot[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 1)).get_Item(index).ToString());
                    change = true;
                    this.SetControllerTransform();
                })), (Component)this);
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <InputField>) this.inpRot).Select <InputField, \u003C\u003E__AnonType14 <InputField, int> >((Func <InputField, int, \u003C\u003E__AnonType14 <InputField, int> >)((p, i) => new \u003C\u003E__AnonType14 <InputField, int>(p, i))).ToList <\u003C\u003E__AnonType14 <InputField, int> >().ForEach((Action <\u003C\u003E__AnonType14 <InputField, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <string>(UnityEventExtensions.AsObservable <string>((UnityEvent <M0>)p.inp.get_onEndEdit()), (Action <M0>)(value =>
                {
                    int index = p.index % 3;
                    float num = CustomBase.ConvertValueFromTextLimit(0.0f, 360f, 0, value);
                    p.inp.set_text(num.ToString());
                    this.chaCtrl.SetAccessoryRot(this.slotNo, this.correctNo, num, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 1] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 1];
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnRotReset).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    this.inpRot[p.index].set_text("0");
                    this.chaCtrl.SetAccessoryRot(this.slotNo, this.correctNo, 0.0f, false, flag[p.index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 1] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 1];
                    this.SetControllerTransform();
                }));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnScl).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    if (change)
                    {
                        return;
                    }
                    int index = p.index / 2;
                    this.chaCtrl.SetAccessoryScl(this.slotNo, this.correctNo, (p.index % 2 != 0 ? 1f : -1f) * this.moveSclValue[this.acsCtrlSetting.correctSetting[this.correctNo].sclRate], true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 2] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 2];
                    this.inpScl[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 2)).get_Item(index).ToString());
                }));
                this.lstDisposable.Add(disposable);
                disposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>(Observable.RepeatUntilDestroy <Unit>(Observable.TakeUntil <Unit, PointerEventData>(Observable.SkipUntil <Unit, PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)p.btn), (IObservable <M1>)Observable.Do <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerDownAsObservable((UIBehaviour)p.btn), (Action <M0>)(_ =>
                {
                    downTimeCnt = 0.0f;
                    loopTimeCnt = 0.0f;
                    change      = false;
                }))), (IObservable <M1>)ObservableTriggerExtensions.OnPointerUpAsObservable((UIBehaviour)p.btn)), (Component)this), (Action <M0>)(_ =>
                {
                    int index    = p.index / 2;
                    float num1   = (p.index % 2 != 0 ? 1f : -1f) * this.moveSclValue[this.acsCtrlSetting.correctSetting[this.correctNo].sclRate];
                    float num2   = 0.0f;
                    downTimeCnt += Time.get_deltaTime();
                    if ((double)downTimeCnt <= 0.300000011920929)
                    {
                        return;
                    }
                    for (loopTimeCnt += Time.get_deltaTime(); (double)loopTimeCnt > 0.0500000007450581; loopTimeCnt -= 0.05f)
                    {
                        num2 += num1;
                    }
                    if ((double)num2 == 0.0)
                    {
                        return;
                    }
                    this.chaCtrl.SetAccessoryScl(this.slotNo, this.correctNo, num2, true, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 2] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 2];
                    this.inpScl[index].set_text(((Vector3) ref this.nowAcs.parts[this.slotNo].addMove.Address(this.correctNo, 2)).get_Item(index).ToString());
                    change = true;
                })), (Component)this);
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <InputField>) this.inpScl).Select <InputField, \u003C\u003E__AnonType14 <InputField, int> >((Func <InputField, int, \u003C\u003E__AnonType14 <InputField, int> >)((p, i) => new \u003C\u003E__AnonType14 <InputField, int>(p, i))).ToList <\u003C\u003E__AnonType14 <InputField, int> >().ForEach((Action <\u003C\u003E__AnonType14 <InputField, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <string>(UnityEventExtensions.AsObservable <string>((UnityEvent <M0>)p.inp.get_onEndEdit()), (Action <M0>)(value =>
                {
                    int index = p.index % 3;
                    float num = CustomBase.ConvertValueFromTextLimit(0.01f, 100f, 2, value);
                    p.inp.set_text(num.ToString());
                    this.chaCtrl.SetAccessoryScl(this.slotNo, this.correctNo, num, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 2] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 2];
                }));
                this.lstDisposable.Add(disposable);
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnSclReset).Select <Button, \u003C\u003E__AnonType13 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType13 <Button, int> >)((p, i) => new \u003C\u003E__AnonType13 <Button, int>(p, i))).ToList <\u003C\u003E__AnonType13 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType13 <Button, int> >)(p =>
            {
                disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(p.btn), (Action <M0>)(_ =>
                {
                    this.inpScl[p.index].set_text("1");
                    this.chaCtrl.SetAccessoryScl(this.slotNo, this.correctNo, 1f, false, flag[p.index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 2] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 2];
                }));
                this.lstDisposable.Add(disposable);
            }));
            disposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnAllReset), (Action <M0>)(_ =>
            {
                for (int index = 0; index < 3; ++index)
                {
                    this.inpPos[index].set_text("0");
                    this.chaCtrl.SetAccessoryPos(this.slotNo, this.correctNo, 0.0f, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 0] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 0];
                    this.SetControllerTransform();
                    this.inpRot[index].set_text("0");
                    this.chaCtrl.SetAccessoryRot(this.slotNo, this.correctNo, 0.0f, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 1] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 1];
                    this.SetControllerTransform();
                    this.inpScl[index].set_text("1");
                    this.chaCtrl.SetAccessoryScl(this.slotNo, this.correctNo, 1f, false, flag[index]);
                    this.orgAcs.parts[this.slotNo].addMove[this.correctNo, 2] = this.nowAcs.parts[this.slotNo].addMove[this.correctNo, 2];
                }
            }));
            this.lstDisposable.Add(disposable);
            disposable = ObservableExtensions.Subscribe <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this.tglDrawCtrl), (Action <M0>)(isOn => this.customBase.customSettingSave.acsCtrlSetting.correctSetting[this.correctNo].draw = isOn));
            this.lstDisposable.Add(disposable);
            if (((IEnumerable <Toggle>) this.tglCtrlType).Any <Toggle>())
            {
                // ISSUE: object of a compiler-generated type is created
                ((IEnumerable <Toggle>) this.tglCtrlType).Select <Toggle, \u003C\u003E__AnonType15 <Toggle, int> >((Func <Toggle, int, \u003C\u003E__AnonType15 <Toggle, int> >)((val, idx) => new \u003C\u003E__AnonType15 <Toggle, int>(val, idx))).Where <\u003C\u003E__AnonType15 <Toggle, int> >((Func <\u003C\u003E__AnonType15 <Toggle, int>, bool>)(item => Object.op_Inequality((Object)item.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <Toggle, int> >().ForEach((Action <\u003C\u003E__AnonType15 <Toggle, int> >)(item =>
                {
                    disposable = ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(item.val), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(isOn =>
                    {
                        this.customBase.customSettingSave.acsCtrlSetting.correctSetting[this.correctNo].type = item.idx;
                        if (!Object.op_Implicit((Object)this.cmpGuid))
                        {
                            return;
                        }
                        this.cmpGuid.SetMode(item.idx);
                    }));
                    this.lstDisposable.Add(disposable);
                }));
            }
            disposable = ObservableExtensions.Subscribe <float>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this.sldCtrlSpeed), (Action <M0>)(val =>
            {
                this.customBase.customSettingSave.acsCtrlSetting.correctSetting[this.correctNo].speed = val;
                if (!Object.op_Implicit((Object)this.cmpGuid))
                {
                    return;
                }
                this.cmpGuid.speedMove = val;
            }));
            this.lstDisposable.Add(disposable);
            disposable = ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnScrollAsObservable((UIBehaviour)this.sldCtrlSpeed), (Action <M0>)(scl =>
            {
                if (!this.customBase.sliderControlWheel)
                {
                    return;
                }
                this.sldCtrlSpeed.set_value(Mathf.Clamp(this.sldCtrlSpeed.get_value() + (float)(scl.get_scrollDelta().y * -0.00999999977648258), 0.1f, 1f));
            }));
            this.lstDisposable.Add(disposable);
            disposable = ObservableExtensions.Subscribe <float>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this.sldCtrlSize), (Action <M0>)(val =>
            {
                this.customBase.customSettingSave.acsCtrlSetting.correctSetting[this.correctNo].scale = val;
                if (!Object.op_Implicit((Object)this.cmpGuid))
                {
                    return;
                }
                this.cmpGuid.scaleAxis = val;
                this.cmpGuid.UpdateScale();
            }));
            this.lstDisposable.Add(disposable);
            disposable = ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnScrollAsObservable((UIBehaviour)this.sldCtrlSize), (Action <M0>)(scl =>
            {
                if (!this.customBase.sliderControlWheel)
                {
                    return;
                }
                this.sldCtrlSize.set_value(Mathf.Clamp(this.sldCtrlSize.get_value() + (float)(scl.get_scrollDelta().y * -0.00999999977648258), 0.3f, 3f));
            }));
            this.lstDisposable.Add(disposable);
            this.UpdateDrawControllerState();
        }
Beispiel #9
0
        protected override void InitializeCommandLabels()
        {
            if (!Singleton <Resources> .IsInstance())
            {
                return;
            }
            if (((IReadOnlyList <CommandLabel.CommandInfo>) this.giveFoodLabels).IsNullOrEmpty <CommandLabel.CommandInfo>())
            {
                Resources instance = Singleton <Resources> .Instance;
                CommonDefine.CommonIconGroup icon = instance.CommonDefine.Icon;
                StuffItemInfo stuffItemInfo       = !Singleton <Resources> .IsInstance() ? (StuffItemInfo)null : Singleton <Resources> .Instance.GameInfo.GetItem(this.foodItemID.categoryID, this.foodItemID.itemID);

                int    guideCancelId = icon.GuideCancelID;
                Sprite sprite;
                instance.itemIconTables.InputIconTable.TryGetValue(guideCancelId, out sprite);
                string _foodItemName = stuffItemInfo?.Name ?? "エサ";
                Dictionary <int, List <string> > commandLabelTextTable = instance.Map.EventPointCommandLabelTextTable;
                List <string> source;
                commandLabelTextTable.TryGetValue(19, out source);
                List <string> _textList1;
                commandLabelTextTable.TryGetValue(20, out _textList1);
                int _langIdx = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt;

                this.giveFoodLabels = new CommandLabel.CommandInfo[1]
                {
                    new CommandLabel.CommandInfo()
                    {
                        Text             = string.Format(source.GetElement <string>(_langIdx) ?? "{0}をあげる", (object)_foodItemName),
                        Transform        = this.LabelPoint,
                        IsHold           = false,
                        Icon             = sprite,
                        TargetSpriteInfo = icon?.CharaSpriteInfo,
                        Condition        = (Func <PlayerActor, bool>)(_player => this.HaveFoodItem()),
                        ErrorText        = (Func <PlayerActor, string>)(_player => string.Format(_textList1.GetElement <string>(_langIdx) ?? "{0}を持っていません。", (object)_foodItemName)),
                        Event            = (Action)(() =>
                        {
                            this.ChangeEmptyLabels();
                            List <StuffItem> self = !Singleton <Manager.Map> .IsInstance() ? (List <StuffItem>)null : Singleton <Manager.Map> .Instance.Player?.PlayerData?.ItemList;
                            if (!((IReadOnlyList <StuffItem>)self).IsNullOrEmpty <StuffItem>())
                            {
                                self.RemoveItem(new StuffItem(this.foodItemID.categoryID, this.foodItemID.itemID, 1));
                            }
                            if (this.CurrentState != AnimalState.Sleep)
                            {
                                this.SetState(AnimalState.LovelyIdle, (Action)(() => this.ChangeGetAnimalLabels()));
                            }
                            else
                            {
                                this.ChangeGetAnimalLabels();
                            }
                            float num = 120f;
                            if (Singleton <Resources> .IsInstance())
                            {
                                AnimalDefinePack animalDefinePack = Singleton <Resources> .Instance.AnimalDefinePack;
                                if (animalDefinePack?.GroundWildInfo != null)
                                {
                                    num = animalDefinePack.GroundWildInfo.LovelyTime;
                                }
                            }
                            if (this.lovelyModeDisposable != null)
                            {
                                this.lovelyModeDisposable.Dispose();
                            }
                            this.lovelyModeDisposable = ObservableExtensions.Subscribe <long>(Observable.Do <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds((double)num)), ((Component)this).get_gameObject()), (Action <M0>)(_ => this.lovelyModeDisposable = (IDisposable)null)), (Action <M0>)(_ =>
                            {
                                if (this.IsLovely)
                                {
                                    this.ChangeEmptyLabels();
                                }
                                switch (this.CurrentState)
                                {
                                case AnimalState.LovelyIdle:
                                    this.SetState(AnimalState.Locomotion, (Action)(() => this.ChangeAnimalLabel()));
                                    break;

                                case AnimalState.LovelyFollow:
                                    this.SetState(AnimalState.Idle, (Action)(() => this.ChangeAnimalLabel()));
                                    break;

                                default:
                                    this.ChangeAnimalLabel();
                                    break;
                                }
                            }));
                        })
                    }
                };
            }
            string _getItemName = (!Singleton <Resources> .IsInstance() ? (StuffItemInfo)null : Singleton <Resources> .Instance.GameInfo.GetItem(this.getItemID.categoryID, this.getItemID.itemID))?.Name ?? "捕獲アイテム";

            if (!((IReadOnlyList <CommandLabel.CommandInfo>) this.getAnimalLabels).IsNullOrEmpty <CommandLabel.CommandInfo>())
            {
                return;
            }
            Resources instance1 = Singleton <Resources> .Instance;

            CommonDefine.CommonIconGroup icon1 = instance1.CommonDefine.Icon;
            int    guideCancelId1 = icon1.GuideCancelID;
            Sprite sprite1;

            instance1.itemIconTables.InputIconTable.TryGetValue(guideCancelId1, out sprite1);
            Dictionary <int, List <string> > commandLabelTextTable1 = instance1.Map.EventPointCommandLabelTextTable;
            List <string> source1;

            commandLabelTextTable1.TryGetValue(21, out source1);
            List <string> _textList1_1;

            commandLabelTextTable1.TryGetValue(20, out _textList1_1);
            int _langIdx1 = !Singleton <GameSystem> .IsInstance() ? 0 : Singleton <GameSystem> .Instance.languageInt;

            this.getAnimalLabels = new CommandLabel.CommandInfo[1]
            {
                new CommandLabel.CommandInfo()
                {
                    Text             = string.Format(source1.GetElement <string>(_langIdx1) ?? "{0}を捕まえる", (object)this.Name),
                    Transform        = this.LabelPoint,
                    IsHold           = false,
                    Icon             = sprite1,
                    Condition        = (Func <PlayerActor, bool>)(_player => this.HaveGetItem()),
                    ErrorText        = (Func <PlayerActor, string>)(_player => string.Format(_textList1_1.GetElement <string>(_langIdx1) ?? "{0}を持っていません。", (object)_getItemName)),
                    TargetSpriteInfo = icon1?.CharaSpriteInfo,
                    Event            = (Action)(() =>
                    {
                        this.ChangeEmptyLabels();
                        this.SetState(AnimalState.WithPlayer, (Action)null);
                        PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player;
                        if (!Object.op_Inequality((Object)playerActor, (Object)null))
                        {
                            return;
                        }
                        playerActor.Animal = (AnimalBase)this;
                        playerActor.PlayerController.ChangeState("CatchAnimal");
                    })
                }
            };
        }