protected override void Start()
        {
            base.Start();
            this.customBase.ChangeAcsSlotName(-1);
            this.customBase.actUpdateCvsAccessory += new Action(((CvsBase)this).UpdateCustomUI);
            if (((IEnumerable <Toggle>) this.tglType).Any <Toggle>())
            {
                // ISSUE: object of a compiler-generated type is created
                ((IEnumerable <Toggle>) this.tglType).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>)(tgl => Object.op_Inequality((Object)tgl.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <Toggle, int> >().ForEach((Action <\u003C\u003E__AnonType15 <Toggle, int> >)(tgl => ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>)tgl.val.onValueChanged), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(isOn => this.ChangeAcsType(tgl.idx)))));
            }
            this.UpdateAcsList(-1);
            this.sscAcs.SetToggleID(this.nowAcs.parts[this.SNo].id);
            this.sscAcs.onSelect = (Action <CustomSelectInfo>)(info =>
            {
                if (info == null || this.nowAcs.parts[this.SNo].id == info.id)
                {
                    return;
                }
                this.ChangeAcsId(info.id);
            });
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <CustomColorSet>) this.csColor).Select <CustomColorSet, \u003C\u003E__AnonType15 <CustomColorSet, int> >((Func <CustomColorSet, int, \u003C\u003E__AnonType15 <CustomColorSet, int> >)((val, idx) => new \u003C\u003E__AnonType15 <CustomColorSet, int>(val, idx))).Where <\u003C\u003E__AnonType15 <CustomColorSet, int> >((Func <\u003C\u003E__AnonType15 <CustomColorSet, int>, bool>)(item => Object.op_Inequality((Object)item.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <CustomColorSet, int> >().ForEach((Action <\u003C\u003E__AnonType15 <CustomColorSet, int> >)(item => item.val.actUpdateColor = (Action <Color>)(color =>
            {
                this.nowAcs.parts[this.SNo].colorInfo[item.idx].color = color;
                this.orgAcs.parts[this.SNo].colorInfo[item.idx].color = color;
                this.chaCtrl.ChangeAccessoryColor(this.SNo);
            })));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <CustomSliderSet>) this.ssGloss).Select <CustomSliderSet, \u003C\u003E__AnonType15 <CustomSliderSet, int> >((Func <CustomSliderSet, int, \u003C\u003E__AnonType15 <CustomSliderSet, int> >)((val, idx) => new \u003C\u003E__AnonType15 <CustomSliderSet, int>(val, idx))).Where <\u003C\u003E__AnonType15 <CustomSliderSet, int> >((Func <\u003C\u003E__AnonType15 <CustomSliderSet, int>, bool>)(item => Object.op_Inequality((Object)item.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <CustomSliderSet, int> >().ForEach((Action <\u003C\u003E__AnonType15 <CustomSliderSet, int> >)(item =>
            {
                item.val.onChange = (Action <float>)(value =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[item.idx].glossPower = value;
                    this.orgAcs.parts[this.SNo].colorInfo[item.idx].glossPower = value;
                    this.chaCtrl.ChangeAccessoryColor(this.SNo);
                });
                item.val.onSetDefaultValue = (Func <float>)(() =>
                {
                    if (Object.op_Equality((Object)null, (Object)this.chaCtrl.cmpAccessory[this.SNo]))
                    {
                        return(0.0f);
                    }
                    switch (item.idx)
                    {
                    case 0:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defGlossPower01);

                    case 1:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defGlossPower02);

                    case 2:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defGlossPower03);

                    case 3:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defGlossPower04);

                    default:
                        return(0.0f);
                    }
                });
            }));
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <CustomSliderSet>) this.ssMetallic).Select <CustomSliderSet, \u003C\u003E__AnonType15 <CustomSliderSet, int> >((Func <CustomSliderSet, int, \u003C\u003E__AnonType15 <CustomSliderSet, int> >)((val, idx) => new \u003C\u003E__AnonType15 <CustomSliderSet, int>(val, idx))).Where <\u003C\u003E__AnonType15 <CustomSliderSet, int> >((Func <\u003C\u003E__AnonType15 <CustomSliderSet, int>, bool>)(item => Object.op_Inequality((Object)item.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <CustomSliderSet, int> >().ForEach((Action <\u003C\u003E__AnonType15 <CustomSliderSet, int> >)(item =>
            {
                item.val.onChange = (Action <float>)(value =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[item.idx].metallicPower = value;
                    this.orgAcs.parts[this.SNo].colorInfo[item.idx].metallicPower = value;
                    this.chaCtrl.ChangeAccessoryColor(this.SNo);
                });
                item.val.onSetDefaultValue = (Func <float>)(() =>
                {
                    if (Object.op_Equality((Object)null, (Object)this.chaCtrl.cmpAccessory[this.SNo]))
                    {
                        return(0.0f);
                    }
                    switch (item.idx)
                    {
                    case 0:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defMetallicPower01);

                    case 1:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defMetallicPower02);

                    case 2:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defMetallicPower03);

                    case 3:
                        return(this.chaCtrl.cmpAccessory[this.SNo].defMetallicPower04);

                    default:
                        return(0.0f);
                    }
                });
            }));
            if (Object.op_Inequality((Object)null, (Object)this.btnDefaultColor))
            {
                ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnDefaultColor), (Action <M0>)(_ =>
                {
                    this.SetDefaultColor();
                    this.chaCtrl.ChangeAccessoryColor(this.SNo);
                    this.UpdateCustomUI();
                }));
            }
            if (Object.op_Implicit((Object)this.csHairBaseColor))
            {
                this.csHairBaseColor.actUpdateColor = (Action <Color>)(color =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[0].color = color;
                    this.orgAcs.parts[this.SNo].colorInfo[0].color = color;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            if (Object.op_Implicit((Object)this.csHairTopColor))
            {
                this.csHairTopColor.actUpdateColor = (Action <Color>)(color =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[1].color = color;
                    this.orgAcs.parts[this.SNo].colorInfo[1].color = color;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            if (Object.op_Implicit((Object)this.csHairUnderColor))
            {
                this.csHairUnderColor.actUpdateColor = (Action <Color>)(color =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[2].color = color;
                    this.orgAcs.parts[this.SNo].colorInfo[2].color = color;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            if (Object.op_Implicit((Object)this.csHairSpecular))
            {
                this.csHairSpecular.actUpdateColor = (Action <Color>)(color =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[3].color = color;
                    this.orgAcs.parts[this.SNo].colorInfo[3].color = color;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            if (Object.op_Implicit((Object)this.ssHairMetallic))
            {
                this.ssHairMetallic.onChange = (Action <float>)(value =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[0].metallicPower = value;
                    this.orgAcs.parts[this.SNo].colorInfo[0].metallicPower = value;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            if (Object.op_Implicit((Object)this.ssHairSmoothness))
            {
                this.ssHairSmoothness.onChange = (Action <float>)(value =>
                {
                    this.nowAcs.parts[this.SNo].colorInfo[0].smoothnessPower = value;
                    this.orgAcs.parts[this.SNo].colorInfo[0].smoothnessPower = value;
                    this.chaCtrl.ChangeHairTypeAccessoryColor(this.SNo);
                });
            }
            // ISSUE: object of a compiler-generated type is created
            ((IEnumerable <Button>) this.btnGetHairColor).Select <Button, \u003C\u003E__AnonType15 <Button, int> >((Func <Button, int, \u003C\u003E__AnonType15 <Button, int> >)((val, idx) => new \u003C\u003E__AnonType15 <Button, int>(val, idx))).Where <\u003C\u003E__AnonType15 <Button, int> >((Func <\u003C\u003E__AnonType15 <Button, int>, bool>)(item => Object.op_Inequality((Object)item.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <Button, int> >().ForEach((Action <\u003C\u003E__AnonType15 <Button, int> >)(item => ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(item.val), (Action <M0>)(_ => this.ChangeHairTypeAccessoryColor(item.idx)))));
            if (((IEnumerable <Toggle>) this.tglParent).Any <Toggle>())
            {
                // ISSUE: object of a compiler-generated type is created
                ((IEnumerable <Toggle>) this.tglParent).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>)(tgl => Object.op_Inequality((Object)tgl.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <Toggle, int> >().ForEach((Action <\u003C\u003E__AnonType15 <Toggle, int> >)(tgl => ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>)tgl.val.onValueChanged), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(isOn => this.ChangeAcsParent(tgl.idx)))));
            }
            if (Object.op_Inequality((Object)null, (Object)this.btnDefaultParent))
            {
                ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnDefaultParent), (Action <M0>)(_ =>
                {
                    this.chaCtrl.ChangeAccessoryParent(this.SNo, this.chaCtrl.GetAccessoryDefaultParentStr(this.SNo));
                    this.orgAcs.parts[this.SNo].parentKey = this.nowAcs.parts[this.SNo].parentKey;
                    this.UpdateCustomUI();
                }));
            }
            ObservableExtensions.Subscribe <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>) this.tglNoShake.onValueChanged), (Action <M0>)(isOn =>
            {
                this.nowAcs.parts[this.SNo].noShake = isOn;
                this.orgAcs.parts[this.SNo].noShake = isOn;
            }));
            GameObject[] gameObjectArray = new GameObject[2]
            {
                this.customBase.objAcs01ControllerTop,
                this.customBase.objAcs02ControllerTop
            };
            for (int _correctNo = 0; _correctNo < this.acCorrect.Length; ++_correctNo)
            {
                this.acCorrect[_correctNo].CreateGuid(gameObjectArray[_correctNo]);
                this.acCorrect[_correctNo].Initialize(this.SNo, _correctNo);
            }
            this.StartCoroutine(this.SetInputText());
            this.backSNo = this.SNo;
        }
Beispiel #2
0
        protected override void OnAwake(PlayerActor player)
        {
            player.EventKey = AIProject.EventType.Search;
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            ValueTuple <int, string> valueTuple;

            AIProject.Definitions.Action.NameTable.TryGetValue(AIProject.EventType.Search, out valueTuple);
            int index = (int)valueTuple.Item1;
            DateActionPointInfo outInfo;

            player.CurrentPoint.TryGetPlayerDateActionPointInfo(player.ChaControl.sex, AIProject.EventType.Search, out outInfo);
            int poseIda = outInfo.poseIDA;

            player.PoseID = poseIda;
            int        _poseID = poseIda;
            Transform  t       = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.baseNullNameA)?.get_transform() ?? ((Component)player.CurrentPoint).get_transform();
            GameObject loop    = ((Component)player.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullNameA);

            player.Animation.RecoveryPoint = loop?.get_transform();
            PlayState playState = Singleton <Resources> .Instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][index][_poseID];

            player.Animation.LoadEventKeyTable(index, outInfo.poseIDA);
            player.LoadEventItems(playState);
            player.LoadEventParticles(index, outInfo.poseIDA);
            player.Animation.InitializeStates(playState);
            ActorAnimInfo actorAnimInfo1 = new ActorAnimInfo()
            {
                layer          = playState.Layer,
                inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
                outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState.DirectionType,
                isLoop         = playState.MainStateInfo.IsLoop,
                endEnableBlend = playState.EndEnableBlend,
                endBlendSec    = playState.EndBlendRate
            };

            player.Partner.Animation.AnimInfo = actorAnimInfo1;
            ActorAnimInfo actorAnimInfo2 = actorAnimInfo1;

            player.Animation.AnimInfo = actorAnimInfo2;
            ActorAnimInfo animInfo = actorAnimInfo2;

            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            player.DeactivateNavMeshAgent();
            player.IsKinematic = true;
            player.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer);
            player.SetStand(t, playState.MainStateInfo.InStateInfo.EnableFade, playState.MainStateInfo.InStateInfo.FadeSecond, playState.DirectionType);
            ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
            player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
            if (player.OldEnabledHoldingHand)
            {
                ((Behaviour)player.HandsHolder).set_enabled(false);
                player.HandsHolder.Weight = 0.0f;
                if (player.HandsHolder.EnabledHolding)
                {
                    player.HandsHolder.EnabledHolding = false;
                }
            }
            player.CameraControl.Mode = CameraMode.ActionFreeLook;
            player.CameraControl.SetShotTypeForce(ShotType.Near);
            player.CameraControl.LoadActionCameraFile(index, _poseID, (Transform)null);
        }
Beispiel #3
0
 protected override void Start()
 {
     base.Start();
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(x => this.SetActiveControl(x))), (Component)this);
     DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>(Observable.Where <long>((IObservable <M0>)Observable.EveryLateUpdate(), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.OnUIUpdate())), (Component)this);
 }
Beispiel #4
0
 public static void FocusAdd(
     this Component component,
     bool isTabKey,
     Func <bool> isFocus,
     Func <int> next,
     Func <Tuple <bool, int> > direct,
     int firstIndex,
     params Selectable[] sels)
 {
     if (((IList <Selectable>)sels).IsNullOrEmpty <Selectable>())
     {
         Debug.LogError((object)"FocusRegister Selection None");
     }
     else
     {
         Selectable lastCurrent = sels.SafeGet <Selectable>(firstIndex);
         ObservableExtensions.Subscribe <Selectable>((IObservable <M0>)Observable.Select <GameObject, Selectable>((IObservable <M0>)ObserveExtensions.ObserveEveryValueChanged <Component, GameObject>((M0)component, (Func <M0, M1>)(_ => EventSystem.get_current().get_currentSelectedGameObject()), (FrameCountType)0, false), (Func <M0, M1>)(go => Object.op_Inequality((Object)go, (Object)null) ? (Selectable)go.GetComponent <Selectable>() : (Selectable)null)), (Action <M0>)(sel =>
         {
             if (((IEnumerable <Selectable>)sels).Contains <Selectable>(sel))
             {
                 lastCurrent = sel;
             }
             else
             {
                 if (!isFocus() || !Object.op_Inequality((Object)lastCurrent, (Object)null))
                 {
                     return;
                 }
                 lastCurrent.Select();
             }
         }));
         Action <int, bool> focus = (Action <int, bool>)((index, isDirect) =>
         {
             bool flag = index >= 0;
             if (!isDirect)
             {
                 index += sels.Check <Selectable>((Func <Selectable, bool>)(v => Object.op_Equality((Object)v, (Object)lastCurrent)));
             }
             MathfEx.LoopValue(ref index, 0, sels.Length - 1);
             if (!sels[index].IsInteractable() && ((IEnumerable <Selectable>)sels).Any <Selectable>((Func <Selectable, bool>)(p => p.IsInteractable())))
             {
                 if (!flag)
                 {
                     index = Mathf.Min(sels.Length, index + 1);
                 }
                 IEnumerable <int> ints1 = Enumerable.Range(index, sels.Length - index);
                 IEnumerable <int> ints2 = Enumerable.Range(0, index);
                 index = (!flag ? ints2.Reverse <int>().Concat <int>(ints1.Reverse <int>()) : ints1.Concat <int>(ints2)).FirstOrDefault <int>((Func <int, bool>)(i => sels[i].IsInteractable()));
             }
             sels[index].Select();
         });
         if (isTabKey)
         {
             ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>(Observable.Where <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable(component), (Func <M0, bool>)(_ => isFocus())), (Func <M0, bool>)(_ => Input.GetKeyDown((KeyCode)9))), (Action <M0>)(_ => focus(Input.GetKey((KeyCode)304) || Input.GetKey((KeyCode)303) ? -1 : 1, false)));
         }
         if (!next.IsNullOrEmpty())
         {
             ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable(component), (Func <M0, bool>)(_ => isFocus())), (Action <M0>)(_ =>
             {
                 int num = next();
                 if (num == 0)
                 {
                     return;
                 }
                 focus(num, false);
             }));
         }
         if (direct.IsNullOrEmpty())
         {
             return;
         }
         ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable(component), (Func <M0, bool>)(_ => isFocus())), (Action <M0>)(_ =>
         {
             Tuple <bool, int> tuple = direct();
             if (!tuple.Item1)
             {
                 return;
             }
             focus(tuple.Item2, true);
         }));
     }
 }
Beispiel #5
0
 public void SubscribeSafe_ArgumentChecking()
 {
     ReactiveAssert.Throws <ArgumentNullException>(() => ObservableExtensions.SubscribeSafe <int>(default(IObservable <int>), Observer.Create <int>(_ => { })));
     ReactiveAssert.Throws <ArgumentNullException>(() => ObservableExtensions.SubscribeSafe <int>(Observable.Return(42), default(IObserver <int>)));
 }
        public void SetStand(
            MerchantActor merchant,
            Transform t,
            bool enableFade,
            float fadeTime,
            int dirc,
            System.Action onComplete = null)
        {
            if (Object.op_Equality((Object)merchant, (Object)null) || Object.op_Equality((Object)t, (Object)null))
            {
                System.Action action = onComplete;
                if (action == null)
                {
                    return;
                }
                action();
            }
            else
            {
                IConnectableObservable <TimeInterval <float> > iconnectableObservable = (IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Linear(fadeTime, false), false));
                IDisposable disposable1 = iconnectableObservable.Connect();
                merchant.DisposeSequenceAction();
                Vector3    position = merchant.Position;
                Quaternion rotation = merchant.Rotation;
                switch (dirc)
                {
                case 0:
                    if (enableFade)
                    {
                        merchant.AddSequenceActionDisposable(disposable1);
                        IDisposable disposable2 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x =>
                        {
                            merchant.Position = Vector3.Lerp(position, t.get_position(), ((TimeInterval <float>) ref x).get_Value());
                            merchant.Rotation = Quaternion.Lerp(rotation, t.get_rotation(), ((TimeInterval <float>) ref x).get_Value());
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable2);
                        IDisposable disposable3 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action != null)
                            {
                                action();
                            }
                            merchant.ClearSequenceAction();
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable3);
                        merchant.AddSequenceActionOnComplete(onComplete);
                        break;
                    }
                    merchant.Position = t.get_position();
                    merchant.Rotation = t.get_rotation();
                    System.Action action1 = onComplete;
                    if (action1 == null)
                    {
                        break;
                    }
                    action1();
                    break;

                case 1:
                    Vector3 vector3 = Vector3.op_Subtraction(((Component)this).get_transform().get_position(), merchant.Position);
                    vector3.y = (__Null)0.0;
                    Quaternion lookRotation = Quaternion.LookRotation(((Vector3) ref vector3).get_normalized(), Vector3.get_up());
                    if (enableFade)
                    {
                        IDisposable disposable2 = ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x => merchant.Rotation = Quaternion.Lerp(rotation, lookRotation, ((TimeInterval <float>) ref x).get_Value())));
                        merchant.AddSequenceActionDisposable(disposable2);
                        IDisposable disposable3 = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action == null)
                            {
                                return;
                            }
                            action();
                        })), (Component)merchant);
                        merchant.AddSequenceActionDisposable(disposable3);
                        merchant.AddSequenceActionOnComplete(onComplete);
                        break;
                    }
                    merchant.Rotation = lookRotation;
                    System.Action action3 = onComplete;
                    if (action3 == null)
                    {
                        break;
                    }
                    action3();
                    break;

                default:
                    System.Action action4 = onComplete;
                    if (action4 == null)
                    {
                        break;
                    }
                    action4();
                    break;
                }
            }
        }
Beispiel #7
0
        public virtual void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey     = EventType.Wash;
            agent.CurrentPoint = agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            agent.ElectNextPoint();
            Resources       instance         = Singleton <Resources> .Instance;
            PoseKeyPair     faceWash         = instance.AgentProfile.PoseIDTable.FaceWash;
            ActionPointInfo actionPointInfo1 = agent.TargetInSightActionPoint.GetActionPointInfo(agent);

            agent.Animation.ActionPointInfo = actionPointInfo1;
            ActionPointInfo actionPointInfo2 = actionPointInfo1;
            Transform       t    = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.baseNullName)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject      loop = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.recoveryNullName);

            agent.Animation.RecoveryPoint = loop?.get_transform();
            agent.ActionID = faceWash.postureID;
            agent.PoseID   = faceWash.poseID;
            PlayState playState = instance.Animation.AgentActionAnimTable[agent.ActionID][agent.PoseID];

            agent.Animation.LoadEventKeyTable(agent.ActionID, agent.PoseID);
            agent.LoadEventItems(playState);
            agent.LoadEventParticles(agent.ActionID, agent.PoseID);
            agent.Animation.InitializeStates(playState);
            ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
            {
                inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
                inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
                inFadeOutTime  = playState.MainStateInfo.FadeOutTime,
                outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
                outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
                directionType  = playState.DirectionType,
                endEnableBlend = playState.EndEnableBlend,
                endBlendSec    = playState.EndBlendRate,
                isLoop         = playState.MainStateInfo.IsLoop,
                loopMinTime    = playState.MainStateInfo.LoopMin,
                loopMaxTime    = playState.MainStateInfo.LoopMax,
                hasAction      = playState.ActionInfo.hasAction,
                layer          = playState.MainStateInfo.InStateInfo.StateInfos[0].layer
            };

            agent.Animation.AnimInfo = actorAnimInfo;
            ActorAnimInfo animInfo = actorAnimInfo;

            agent.LoadActionFlag(agent.ActionID, agent.PoseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.StopAllAnimCoroutine();
            agent.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, playState.MainStateInfo.FadeOutTime, animInfo.layer);
            this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnEndActionAsObservable(), 1), (System.Action <M0>)(_ => agent.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
            if (animInfo.hasAction)
            {
                this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnActionPlayAsObservable(), (System.Action <M0>)(_ => agent.Animation.PlayActionAnimation(animInfo.layer)));
            }
            this._onCompleteActionDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnCompleteActionAsObservable(), (System.Action <M0>)(_ => this.Complete()));
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(t, playState.MainStateInfo.InStateInfo.EnableFade, playState.MainStateInfo.InStateInfo.FadeSecond, playState.DirectionType);
            if (!animInfo.isLoop)
            {
                return;
            }
            agent.SetCurrentSchedule(animInfo.isLoop, actionPointInfo2.actionName, animInfo.loopMinTime, animInfo.loopMaxTime, animInfo.hasAction, false);
        }
 private void Start()
 {
     this._canvasGroup.set_alpha(0.0f);
     ObservableExtensions.Subscribe <string>(Observable.Where <string>((IObservable <M0>) this._text, (Func <M0, bool>)(x => ((TMP_Text)this._label).get_text() != x)), (System.Action <M0>)(x => ((TMP_Text)this._label).set_text(x)));
 }
 private void Start()
 {
     this.handleName = Singleton <GameSystem> .Instance.HandleName;
     this.inpHandleName.set_text(this.handleName);
     this.inpHandleName.ActivateInputField();
     ObservableExtensions.Subscribe <string>((IObservable <M0>)UnityUIComponentExtensions.OnEndEditAsObservable(this.inpHandleName), (Action <M0>)(buf =>
     {
         this.notIllusion = !(buf == "イリュージョン公式");
         this.handleName  = buf;
     }));
     if (Object.op_Implicit((Object)this.btnYes))
     {
         TextMeshProUGUI text = (TextMeshProUGUI)((Component)this.btnYes).GetComponentInChildren <TextMeshProUGUI>(true);
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this.btnYes), (Action <M0>)(_ =>
         {
             bool flag = !this.handleName.IsNullOrEmpty() && this.notIllusion;
             ((Selectable)this.btnYes).set_interactable(flag);
             if (!Object.op_Implicit((Object)text))
             {
                 return;
             }
             ((Graphic)text).set_color(new Color((float)((Graphic)text).get_color().r, (float)((Graphic)text).get_color().g, (float)((Graphic)text).get_color().b, !flag ? 0.5f : 1f));
         }));
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnYes), (Action <M0>)(_ =>
         {
             Singleton <GameSystem> .Instance.SaveHandleName(this.handleName);
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_S);
             ((Component)this.cvsChangeScene).get_gameObject().SetActive(true);
             if ("Uploader" == this.backSceneName || "Downloader" == this.backSceneName)
             {
                 Singleton <Scene> .Instance.UnLoad();
             }
             else
             {
                 Singleton <Scene> .Instance.LoadReserve(new Scene.Data()
                 {
                     levelName = "NetworkCheckScene",
                     isAdd     = false,
                     isFade    = true,
                     isAsync   = true
                 }, true);
             }
         }));
     }
     if (!Object.op_Implicit((Object)this.btnNo))
     {
         return;
     }
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnNo), (Action <M0>)(_ =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         if ("Uploader" == this.backSceneName || "Downloader" == this.backSceneName)
         {
             Singleton <Scene> .Instance.UnLoad();
         }
         else
         {
             Singleton <Scene> .Instance.LoadReserve(new Scene.Data()
             {
                 levelName = "Title",
                 isFade    = true
             }, false);
         }
     }));
 }
 private void Start()
 {
     ObservableExtensions.Subscribe <long>(Observable.Where <long>(Observable.Where <long>((IObservable <M0>)Observable.EveryUpdate(), (Func <M0, bool>)(_ => !this.CompletedScenario)), (Func <M0, bool>)(_ => this.CompletedCommand)), (Action <M0>)(_ => this.ExecuteNextLine()));
 }
Beispiel #11
0
 private void Start()
 {
     ObservableExtensions.Subscribe <long>(Observable.Where <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryLateUpdate(), ((Component)this).get_gameObject()), (Func <M0, bool>)(_ => ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.OnLateUpdate()));
 }
 public void WaitSeconds(float duration, bool acceptInput = false)
 {
     ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => this.WaitSecondsCoroutine(duration, acceptInput)), false), ((Component)this).get_gameObject()), (Action <M0>)(_ => this.CompletedCommand = true));
 }
 public void WaitForFading()
 {
     ObservableExtensions.Subscribe <Unit>(Observable.TakeUntilDestroy <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => this.WaitWhileFading()), false), ((Component)this).get_gameObject()), (Action <M0>)(_ => {}));
 }
Beispiel #14
0
        public virtual void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey     = EventType.Eat;
            agent.CurrentPoint = agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            agent.ElectNextPoint();
            agent.CurrentPoint.SetActiveMapItemObjs(false);
            StuffItem carryingItem = agent.AgentData.CarryingItem;

            ItemIDKeyPair[] canStandEatItems = Singleton <Resources> .Instance.AgentProfile.CanStandEatItems;
            bool            flag             = false;

            foreach (ItemIDKeyPair itemIdKeyPair in canStandEatItems)
            {
                if (carryingItem.CategoryID == itemIdKeyPair.categoryID && carryingItem.ID == itemIdKeyPair.itemID)
                {
                    flag = true;
                    break;
                }
            }
            ActionPointInfo outInfo;

            if (flag)
            {
                PoseKeyPair eatDeskId  = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.EatDeskID;
                PoseKeyPair eatChairId = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.EatChairID;
                if (agent.TargetInSightActionPoint.FindAgentActionPointInfo(EventType.Eat, eatDeskId.poseID, out outInfo))
                {
                    agent.Animation.ActionPointInfo = outInfo;
                }
                else if (agent.TargetInSightActionPoint.FindAgentActionPointInfo(EventType.Eat, eatChairId.poseID, out outInfo))
                {
                    agent.Animation.ActionPointInfo = outInfo;
                }
            }
            else
            {
                PoseKeyPair eatDishId = Singleton <Resources> .Instance.AgentProfile.PoseIDTable.EatDishID;
                if (agent.TargetInSightActionPoint.FindAgentActionPointInfo(EventType.Eat, eatDishId.poseID, out outInfo))
                {
                    agent.Animation.ActionPointInfo = outInfo;
                }
            }
            Transform  t    = ((Component)agent.CurrentPoint).get_transform().FindLoop(outInfo.baseNullName)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject loop = ((Component)agent.CurrentPoint).get_transform().FindLoop(outInfo.recoveryNullName);

            agent.Animation.RecoveryPoint = loop?.get_transform();
            int eventId = outInfo.eventID;

            agent.ActionID = eventId;
            int index  = eventId;
            int poseId = outInfo.poseID;

            agent.PoseID = poseId;
            int                   poseID   = poseId;
            PlayState             info     = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[index][poseID];
            ActorAnimInfo         animInfo = agent.Animation.LoadActionState(index, poseID, info);
            Dictionary <int, int> dictionary;
            int                   num;
            ActionItemInfo        eventItemInfo;

            if (Singleton <Resources> .Instance.Map.FoodEventItemList.TryGetValue(carryingItem.CategoryID, out dictionary) && dictionary.TryGetValue(carryingItem.ID, out num) && Singleton <Resources> .Instance.Map.EventItemList.TryGetValue(num, out eventItemInfo))
            {
                LocomotionProfile locomotionProfile = Singleton <Resources> .Instance.LocomotionProfile;
                string            parentName        = !flag ? locomotionProfile.RootParentName : locomotionProfile.RightHandParentName;
                GameObject        gameObject        = agent.LoadEventItem(num, parentName, false, eventItemInfo);
                if (Object.op_Inequality((Object)gameObject, (Object)null))
                {
                    foreach (Renderer componentsInChild in (Renderer[])gameObject.GetComponentsInChildren <Renderer>(true))
                    {
                        componentsInChild.set_enabled(true);
                    }
                }
            }
            agent.LoadActionFlag(index, poseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.StopAllAnimCoroutine();
            agent.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, info.MainStateInfo.FadeOutTime, animInfo.layer);
            this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnEndActionAsObservable(), 1), (System.Action <M0>)(_ =>
            {
                agent.Animation.StopAllAnimCoroutine();
                agent.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer);
            }));
            if (animInfo.hasAction)
            {
                this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnActionPlayAsObservable(), (System.Action <M0>)(_ => agent.Animation.PlayActionAnimation(animInfo.layer)));
            }
            this._onCompleteActionDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnCompleteActionAsObservable(), (System.Action <M0>)(_ => this.Complete()));
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(t, info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.DirectionType);
            if (!animInfo.isLoop)
            {
                return;
            }
            agent.SetCurrentSchedule(animInfo.isLoop, outInfo.actionName, animInfo.loopMinTime, animInfo.loopMaxTime, animInfo.hasAction, true);
        }
        protected override void OnBeforeStart()
        {
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (System.Action <M0>)(active => this.SetActiveControl(active)));
            for (int index = 0; index < this._charaButtons.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey2 startCAnonStorey2 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey2();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey2.\u0024this = this;
                Button charaButton = this._charaButtons[index];
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey2.id = index;
                // ISSUE: method pointer
                ((UnityEvent)charaButton.get_onClick()).AddListener(new UnityAction((object)startCAnonStorey2, __methodptr(\u003C\u003Em__0)));
            }
            ObservableExtensions.Subscribe <int>((IObservable <M0>) this.OnSelectIDChangedAsObservable(), (System.Action <M0>)(x =>
            {
                ((Selectable)this._charaCreateButton).set_interactable(x != -1);
                ((UnityEngine.Component) this._selectedImageTransform).get_gameObject().SetActiveIfDifferent(x != -1);
                if (((UnityEngine.Component) this._selectedImageTransform).get_gameObject().get_activeSelf())
                {
                    ((Transform)this._selectedImageTransform).set_localPosition(((Transform)this._elements[x]).get_localPosition());
                }
                GameCharaFileInfo element = this._infos.GetElement <GameCharaFileInfo>(x);
                if (element == null)
                {
                    return;
                }
                if (!element.FullPath.IsNullOrEmpty())
                {
                    bool activeSelf = this._objFemaleParameterWindow.get_activeSelf();
                    this._objFemaleParameterWindow.SetActiveIfDifferent(true);
                    if (!activeSelf)
                    {
                        this._femaleParameterSelectNum = 0;
                        this._tglFemaleStateSelects[0].SetIsOnWithoutCallback(true);
                        for (int index = 0; index < this._objFemaleParameterRoots.Length; ++index)
                        {
                            this._objFemaleParameterRoots[index].SetActiveIfDifferent(index == 0);
                        }
                    }
                    this._txtFemaleCharaName.set_text(element.name);
                    this._riFemaleCard.set_texture((Texture)PngAssist.ChangeTextureFromByte(PngFile.LoadPngBytes(element.FullPath), 0, 0, (TextureFormat)5, false));
                    for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
                    {
                        this._sccStateOfProgress[index].OnChangeValue(element.phase >= index ? 1 : 0);
                    }
                    string empty = string.Empty;
                    this._txtLifeStyle.set_text(!Lifestyle.LifestyleName.TryGetValue(element.lifeStyle, out empty) ? "--------------------" : (element.lifeStyle != 4 ? empty : "E・シーカー"));
                    this._txtGirlPower.set_text(element.flavorState[0].ToString());
                    this._txtTrust.set_text(element.flavorState[1].ToString());
                    this._txtHumanNature.set_text(element.flavorState[2].ToString());
                    this._txtInstinct.set_text(element.flavorState[3].ToString());
                    this._txtHentai.set_text(element.flavorState[4].ToString());
                    this._txtVigilance.set_text(element.flavorState[5].ToString());
                    this._txtSocial.set_text(element.flavorState[7].ToString());
                    this._txtDarkness.set_text(element.flavorState[6].ToString());
                    for (int key = 0; key < this._txtNormalSkillSlots.Length; ++key)
                    {
                        string str = "--------------------";
                        if (element.normalSkill.ContainsKey(key))
                        {
                            str = Singleton <Resources> .Instance.GameInfo.GetItem(16, element.normalSkill[key])?.Name ?? "--------------------";
                        }
                        this._txtNormalSkillSlots[key].set_text(str);
                    }
                    for (int key = 0; key < this._txtHSkillSlots.Length; ++key)
                    {
                        string str = "--------------------";
                        if (element.hSkill.ContainsKey(key))
                        {
                            str = Singleton <Resources> .Instance.GameInfo.GetItem(17, element.hSkill[key])?.Name ?? "--------------------";
                        }
                        this._txtHSkillSlots[key].set_text(str);
                    }
                }
                else
                {
                    this._txtFemaleCharaName.set_text(string.Empty);
                    this._riFemaleCard.set_texture((Texture)this._texEmpty);
                    for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
                    {
                        this._sccStateOfProgress[index].OnChangeValue(element.phase >= index ? 1 : 0);
                    }
                    this._txtLifeStyle.set_text(string.Empty);
                    this._txtGirlPower.set_text(string.Empty);
                    this._txtTrust.set_text(string.Empty);
                    this._txtHumanNature.set_text(string.Empty);
                    this._txtInstinct.set_text(string.Empty);
                    this._txtHentai.set_text(string.Empty);
                    this._txtVigilance.set_text(string.Empty);
                    this._txtSocial.set_text(string.Empty);
                    this._txtDarkness.set_text(string.Empty);
                    for (int index = 0; index < this._txtNormalSkillSlots.Length; ++index)
                    {
                        string str = "--------------------";
                        this._txtNormalSkillSlots[index].set_text(str);
                    }
                    for (int index = 0; index < this._txtHSkillSlots.Length; ++index)
                    {
                        string str = "--------------------";
                        this._txtHSkillSlots[index].set_text(str);
                    }
                }
            }));
            this._objFemaleParameterWindow.SetActiveIfDifferent(false);
            this._txtFemaleCharaName.set_text("NoName");
            this._riFemaleCard.set_texture((Texture)null);
            for (int index = 0; index < this._sccStateOfProgress.Length; ++index)
            {
                this._sccStateOfProgress[index].OnChangeValue(index != 0 ? 0 : 1);
            }
            for (int index = 0; index < this._tglFemaleStateSelects.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey3 startCAnonStorey3 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey3();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey3.\u0024this = this;
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey3.sel = index;
                // ISSUE: reference to a compiler-generated method
                // ISSUE: reference to a compiler-generated method
                ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>) this._tglFemaleStateSelects[index].onValueChanged), (Func <M0, bool>) new Func <bool, bool>(startCAnonStorey3.\u003C\u003Em__0)), (System.Action <M0>) new System.Action <bool>(startCAnonStorey3.\u003C\u003Em__1));
            }
            for (int index = 0; index < this._actionStateSelects.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey4 startCAnonStorey4 = new CharaLookEditUI.\u003COnBeforeStart\u003Ec__AnonStorey4();
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey4.\u0024this = this;
                // ISSUE: reference to a compiler-generated field
                startCAnonStorey4.sel = index;
                // ISSUE: method pointer
                this._actionStateSelects[index].listActionEnter.Add(new UnityAction((object)startCAnonStorey4, __methodptr(\u003C\u003Em__0)));
                // ISSUE: method pointer
                this._actionStateSelects[index].listActionExit.Add(new UnityAction((object)startCAnonStorey4, __methodptr(\u003C\u003Em__1)));
            }
            for (int index = 0; index < this._objFemaleStateSelectSels.Length; ++index)
            {
                this._objFemaleStateSelectSels[index].SetActiveIfDifferent(false);
            }
            this._txtLifeStyle.set_text(string.Empty);
            this._txtGirlPower.set_text("0");
            this._txtTrust.set_text("0");
            this._txtHumanNature.set_text("0");
            this._txtInstinct.set_text("0");
            this._txtHentai.set_text("0");
            this._txtVigilance.set_text("0");
            this._txtSocial.set_text("0");
            this._txtDarkness.set_text("0");
            for (int index = 0; index < this._txtNormalSkillSlots.Length; ++index)
            {
                this._txtNormalSkillSlots[index].set_text("--------------------");
            }
            for (int index = 0; index < this._txtHSkillSlots.Length; ++index)
            {
                this._txtHSkillSlots[index].set_text("--------------------");
            }
            KeyCodeDownCommand keyCodeDownCommand = new KeyCodeDownCommand()
            {
                KeyCode = (KeyCode)324
            };

            // ISSUE: method pointer
            keyCodeDownCommand.TriggerEvent.AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__2)));
            this._keyCommands.Add(keyCodeDownCommand);
            // ISSUE: method pointer
            ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__3)));
            // ISSUE: method pointer
            ((UnityEvent)this._charaCreateButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003COnBeforeStart\u003Em__4)));
            ((Selectable)this._charaCreateButton).set_interactable(false);
            ((UnityEngine.Component) this._selectedImageTransform).get_gameObject().SetActive(false);
        }
 private void Start()
 {
     ObservableExtensions.Subscribe <long>(Observable.Where <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryEndOfFrame(), ((Component)this).get_gameObject()), (Func <M0, bool>)(_ => Object.op_Inequality((Object)this, (Object)null) && ((Behaviour)this).get_isActiveAndEnabled())), (Action <M0>)(_ => this.Restore()));
 }
        private void SetActiveControl(bool active)
        {
            Manager.Input instance = Singleton <Manager.Input> .Instance;
            IEnumerator   coroutine;

            if (active)
            {
                ((ReactiveProperty <int>) this._selectedID).set_Value(-1);
                Time.set_timeScale(0.0f);
                Dictionary <int, AgentData> agentTable = Singleton <Game> .Instance.WorldData.AgentTable;
                for (int key = 0; key < 4; ++key)
                {
                    AgentData      agentData      = agentTable[key];
                    ChaFileControl chaFileControl = new ChaFileControl();
                    if (!agentData.CharaFileName.IsNullOrEmpty() && chaFileControl.LoadCharaFile(agentData.CharaFileName, (byte)1, false, true))
                    {
                        string          empty = string.Empty;
                        VoiceInfo.Param obj;
                        string          str = Singleton <Manager.Voice> .Instance.voiceInfoDic.TryGetValue(chaFileControl.parameter.personality, out obj) ? obj.Personality : "不明";

                        this._infos[key] = new GameCharaFileInfo()
                        {
                            name             = chaFileControl.parameter.fullname,
                            personality      = str,
                            voice            = chaFileControl.parameter.personality,
                            hair             = chaFileControl.custom.hair.kind,
                            birthMonth       = (int)chaFileControl.parameter.birthMonth,
                            birthDay         = (int)chaFileControl.parameter.birthDay,
                            strBirthDay      = chaFileControl.parameter.strBirthDay,
                            sex              = (int)chaFileControl.parameter.sex,
                            FullPath         = string.Format("{0}chara/female/{1}.png", (object)UserData.Path, (object)agentData.CharaFileName),
                            FileName         = agentData.CharaFileName,
                            gameRegistration = chaFileControl.gameinfo.gameRegistration,
                            flavorState      = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.flavorState),
                            phase            = chaFileControl.gameinfo.phase,
                            normalSkill      = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.normalSkill),
                            hSkill           = new Dictionary <int, int>((IDictionary <int, int>)chaFileControl.gameinfo.hSkill),
                            favoritePlace    = chaFileControl.gameinfo.favoritePlace,
                            futanari         = chaFileControl.parameter.futanari,
                            lifeStyle        = chaFileControl.gameinfo.lifestyle,
                            data_uuid        = chaFileControl.dataID
                        };
                    }
                    else
                    {
                        this._infos[key] = (GameCharaFileInfo)null;
                    }
                    if (this._infos[key] != null)
                    {
                        this._charaTexts[key].set_text(this._infos[key].name ?? "-----");
                    }
                    else
                    {
                        this._charaTexts[key].set_text("-----");
                    }
                    this._objFemaleParameterWindow.SetActiveIfDifferent(false);
                    ((UnityEngine.Component) this._charaButtons[key]).get_gameObject().SetActiveIfDifferent(agentData.OpenState);
                    if (((UnityEngine.Component) this._charaButtons[key]).get_gameObject().get_activeSelf())
                    {
                        ((Selectable)this._charaButtons[key]).set_interactable(agentTable.ContainsKey(key) && !agentTable[key].CharaFileName.IsNullOrEmpty());
                    }
                }
                instance.FocusLevel   = 0;
                instance.MenuElements = this.MenuUIList;
                coroutine             = this.OpenCoroutine();
            }
            else
            {
                instance.ClearMenuElements();
                instance.FocusLevel = -1;
                coroutine           = this.CloseCoroutine();
            }
            if (this._fadeDisposable != null)
            {
                this._fadeDisposable.Dispose();
            }
            this._fadeDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false), (System.Action <M0>)(_ => {}), (System.Action <Exception>)(ex => Debug.LogException(ex)));
        }
 public void Init()
 {
     ObservableExtensions.Subscribe(Host.WindowResized, pos => CreateImage((int)pos.Width, (int)pos.Height));
     _stopwatch.Start();
 }
        public void SetStand(
            Transform root,
            Transform t,
            bool enableFade,
            float fadeTime,
            int dirc,
            System.Action onComplete = null)
        {
            if (Object.op_Equality((Object)root, (Object)null) || Object.op_Equality((Object)t, (Object)null))
            {
                System.Action action = onComplete;
                if (action == null)
                {
                    return;
                }
                action();
            }
            else
            {
                IConnectableObservable <TimeInterval <float> > iconnectableObservable = (IConnectableObservable <TimeInterval <float> >)Observable.Publish <TimeInterval <float> >((IObservable <M0>)Observable.FrameTimeInterval <float>((IObservable <M0>)ObservableEasing.Linear(fadeTime, false), false));
                iconnectableObservable.Connect();
                Vector3    position = root.get_position();
                Quaternion rotation = root.get_rotation();
                switch (dirc)
                {
                case 0:
                    if (enableFade)
                    {
                        ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x =>
                        {
                            root.set_position(Vector3.Lerp(position, t.get_position(), ((TimeInterval <float>) ref x).get_Value()));
                            root.set_rotation(Quaternion.Lerp(rotation, t.get_rotation(), ((TimeInterval <float>) ref x).get_Value()));
                        }));
                        ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action == null)
                            {
                                return;
                            }
                            action();
                        }));
                        break;
                    }
                    root.set_position(t.get_position());
                    root.set_rotation(t.get_rotation());
                    System.Action action1 = onComplete;
                    if (action1 == null)
                    {
                        break;
                    }
                    action1();
                    break;

                case 1:
                    Vector3 vector3 = Vector3.op_Subtraction(((Component)this).get_transform().get_position(), root.get_position());
                    vector3.y = (__Null)0.0;
                    Quaternion lookRotation = Quaternion.LookRotation(((Vector3) ref vector3).get_normalized(), Vector3.get_up());
                    if (enableFade)
                    {
                        ObservableExtensions.Subscribe <TimeInterval <float> >((IObservable <M0>)iconnectableObservable, (System.Action <M0>)(x => root.set_rotation(Quaternion.Lerp(rotation, lookRotation, ((TimeInterval <float>) ref x).get_Value()))));
                        ObservableExtensions.Subscribe <TimeInterval <float>[]>((IObservable <M0>)Observable.WhenAll <TimeInterval <float> >((IObservable <M0>[]) new IObservable <TimeInterval <float> >[1]
                        {
                            (IObservable <TimeInterval <float> >)iconnectableObservable
                        }), (System.Action <M0>)(_ =>
                        {
                            System.Action action = onComplete;
                            if (action == null)
                            {
                                return;
                            }
                            action();
                        }));
                        break;
                    }
                    root.set_rotation(lookRotation);
                    System.Action action3 = onComplete;
                    if (action3 == null)
                    {
                        break;
                    }
                    action3();
                    break;

                default:
                    System.Action action4 = onComplete;
                    if (action4 == null)
                    {
                        break;
                    }
                    action4();
                    break;
                }
            }
        }
 private void Start()
 {
     ObservableExtensions.Subscribe <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), (Component)this), (Action <M0>)(_ => this.OnUpdate()));
 }
Beispiel #21
0
 public static IDisposable SubscribeToText(
     this IObservable <string> source,
     TextMeshProUGUI text)
 {
     return(ObservableExtensions.SubscribeWithState <string, TextMeshProUGUI>((IObservable <M0>)source, (M1)text, (Action <M0, M1>)((x, t) => ((TMP_Text)t).set_text(x))));
 }
Beispiel #22
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            AgentActor agent = this.Agent;

            agent.ElectNextPoint();
            this._poseInfo = new PoseKeyPair?();
            if (Random.Range(0, 2) == 0 || agent.PrevMode == Desire.ActionType.Encounter)
            {
                return;
            }
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            AgentProfile agentProfile = Singleton <Resources> .Instance.AgentProfile;
            float        num1         = agent.AgentData.StatsTable[0];
            float        num2         = agent.AgentData.StatsTable[2];
            int          desireKey1   = Desire.GetDesireKey(Desire.Type.Bath);
            float?       desire1      = agent.GetDesire(desireKey1);
            int          desireKey2   = Desire.GetDesireKey(Desire.Type.Sleep);
            float?       desire2      = agent.GetDesire(desireKey2);

            if (agent.AgentData.SickState.ID == 0)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.CoughID);
            }
            else if ((!desire2.HasValue ? 0 : ((double)desire2.GetValueOrDefault() >= 70.0 ? 1 : 0)) != 0)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.YawnID);
            }
            else if ((!desire1.HasValue ? 0 : ((double)desire1.GetValueOrDefault() >= 70.0 ? 1 : 0)) != 0)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.GrossID);
            }
            else if ((double)num1 <= (double)agentProfile.ColdTempBorder)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.ColdPoseID);
            }
            else if ((double)num1 >= (double)agentProfile.HotTempBorder)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.HotPoseID);
            }
            else if ((double)num2 <= 0.0)
            {
                this._poseInfo = new PoseKeyPair?(agentProfile.PoseIDTable.HungryID);
            }
            if (!this._poseInfo.HasValue)
            {
                return;
            }
            PoseKeyPair poseKeyPair = this._poseInfo.Value;

            agent.ActionID = poseKeyPair.postureID;
            agent.PoseID   = poseKeyPair.poseID;
            PlayState     info     = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[poseKeyPair.postureID][poseKeyPair.poseID];
            ActorAnimInfo animInfo = agent.Animation.LoadActionState(poseKeyPair.postureID, poseKeyPair.poseID, info);

            agent.LoadActionFlag(poseKeyPair.postureID, poseKeyPair.poseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.RecoveryPoint = (Transform)null;
            agent.Animation.StopAllAnimCoroutine();
            agent.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, info.MainStateInfo.FadeOutTime, animInfo.layer);
            this._onEndActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnEndActionAsObservable(), 1), (System.Action <M0>)(_ =>
            {
                agent.Animation.StopAllAnimCoroutine();
                agent.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer);
            }));
            if (animInfo.hasAction)
            {
                this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnActionPlayAsObservable(), (System.Action <M0>)(_ => this.Agent.Animation.PlayActionAnimation(animInfo.layer)));
            }
            this._onCompleteActionDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnCompleteActionAsObservable(), 1), (System.Action <M0>)(_ => this.Complete()));
            if (!animInfo.isLoop)
            {
                return;
            }
            agent.SetCurrentSchedule(animInfo.isLoop, "立ちアクション", animInfo.loopMinTime, animInfo.loopMaxTime, animInfo.hasAction, false);
        }
Beispiel #23
0
 public void Start()
 {
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnShowWinSort), (Action <M0>)(_ => this.winSort.objWinSort.SetActiveIfDifferent(!this.winSort.objWinSort.get_activeSelf())));
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.winSort.btnCloseWinSort), (Action <M0>)(_ => this.winSort.objWinSort.SetActiveIfDifferent(false)));
     if (((IEnumerable <Toggle>) this.winSort.tglSort).Any <Toggle>())
     {
         // ISSUE: object of a compiler-generated type is created
         ((IEnumerable <Toggle>) this.winSort.tglSort).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>)(tgl => Object.op_Inequality((Object)tgl.val, (Object)null))).ToList <\u003C\u003E__AnonType15 <Toggle, int> >().ForEach((Action <\u003C\u003E__AnonType15 <Toggle, int> >)(tgl => ObservableExtensions.Subscribe <bool>(Observable.Where <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(tgl.val), (Func <M0, bool>)(isOn => isOn)), (Action <M0>)(isOn => this.sortType = tgl.idx))));
     }
     ObservableExtensions.Subscribe <bool>((IObservable <M0>)UnityUIComponentExtensions.OnValueChangedAsObservable(this.tglSortOrder), (Action <M0>)(isOn => this.sortOrder = !isOn ? 1 : 0));
     ObservableExtensions.Subscribe <int>((IObservable <M0>) this._sortType, (Action <M0>)(_ => this.Sort()));
     ObservableExtensions.Subscribe <int>((IObservable <M0>) this._sortOrder, (Action <M0>)(_ => this.Sort()));
     if (this.button == null || this.button.Length != 3)
     {
         return;
     }
     if (Object.op_Implicit((Object)this.button[0]))
     {
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.button[0]), (Action <M0>)(_ =>
         {
             if (this.onClick01 == null)
             {
                 return;
             }
             this.onClick01(this.cscClothes.selectInfo?.info);
         }));
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this.button[0]), (Action <M0>)(_ => ((Selectable)this.button[0]).set_interactable((!this.btnDisableNotSelect01 ? 0 : (null == this.cscClothes.selectInfo ? 1 : 0)) == 0)));
     }
     if (Object.op_Implicit((Object)this.button[1]))
     {
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.button[1]), (Action <M0>)(_ =>
         {
             if (this.onClick02 == null)
             {
                 return;
             }
             this.onClick02(this.cscClothes.selectInfo?.info);
         }));
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this.button[1]), (Action <M0>)(_ => ((Selectable)this.button[1]).set_interactable((!this.btnDisableNotSelect02 ? 0 : (null == this.cscClothes.selectInfo ? 1 : 0)) == 0)));
     }
     if (!Object.op_Implicit((Object)this.button[2]))
     {
         return;
     }
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.button[2]), (Action <M0>)(_ =>
     {
         if (this.onClick03 == null)
         {
             return;
         }
         this.onClick03(this.cscClothes.selectInfo?.info);
     }));
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((Component)this.button[2]), (Action <M0>)(_ => ((Selectable)this.button[2]).set_interactable((!this.btnDisableNotSelect03 ? 0 : (null == this.cscClothes.selectInfo ? 1 : 0)) == 0)));
 }
        public virtual void OnStart()
        {
            AgentActor agent = this.Agent;

            agent.EventKey     = EventType.Sleep;
            agent.CurrentPoint = agent.TargetInSightActionPoint;
            agent.SetActiveOnEquipedItem(false);
            agent.ChaControl.setAllLayerWeight(0.0f);
            agent.ElectNextPoint();
            agent.CurrentPoint.SetActiveMapItemObjs(false);
            ActionPointInfo actionPointInfo1 = agent.TargetInSightActionPoint.GetActionPointInfo(agent);

            agent.Animation.ActionPointInfo = actionPointInfo1;
            ActionPointInfo actionPointInfo2 = actionPointInfo1;
            Transform       t    = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.baseNullName)?.get_transform() ?? ((Component)agent.CurrentPoint).get_transform();
            GameObject      loop = ((Component)agent.CurrentPoint).get_transform().FindLoop(actionPointInfo2.recoveryNullName);

            agent.Animation.RecoveryPoint = loop?.get_transform();
            int eventId = actionPointInfo2.eventID;

            agent.ActionID = eventId;
            int index  = eventId;
            int poseId = actionPointInfo2.poseID;

            agent.PoseID = poseId;
            int       poseID = poseId;
            PlayState info   = Singleton <Resources> .Instance.Animation.AgentActionAnimTable[index][poseID];

            agent.CurrentPoint.DestroyByproduct(index, poseID);
            ActorAnimInfo animInfo = agent.Animation.LoadActionState(index, poseID, info);

            agent.LoadActionFlag(index, poseID);
            agent.DeactivateNavMeshAgent();
            agent.Animation.StopAllAnimCoroutine();
            agent.Animation.PlayInAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.inFadeOutTime, animInfo.layer);
            this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>)agent.AnimationAgent.OnEndActionAsObservable(), 1), (System.Action <M0>)(_ =>
            {
                agent.Animation.StopAllAnimCoroutine();
                agent.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer);
            }));
            if (animInfo.hasAction)
            {
                this._onActionPlayDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnActionPlayAsObservable(), (System.Action <M0>)(_ => agent.Animation.PlayActionAnimation(animInfo.layer)));
            }
            this._onCompleteActionDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)agent.AnimationAgent.OnCompleteActionAsObservable(), (System.Action <M0>)(_ => this.Complete()));
            agent.CurrentPoint.SetSlot((Actor)agent);
            agent.SetStand(t, info.MainStateInfo.InStateInfo.EnableFade, info.MainStateInfo.InStateInfo.FadeSecond, info.DirectionType);
            if (animInfo.isLoop)
            {
                agent.SetCurrentSchedule(animInfo.isLoop, actionPointInfo2.actionName, 100, 200, animInfo.hasAction, true);
                if (agent.AgentData.ScheduleEnabled)
                {
                    Actor.BehaviorSchedule schedule = agent.Schedule;
                    schedule.enabled                = agent.AgentData.ScheduleEnabled;
                    schedule.elapsedTime            = agent.AgentData.ScheduleElapsedTime;
                    schedule.duration               = agent.AgentData.ScheduleDuration;
                    agent.Schedule                  = schedule;
                    agent.AgentData.ScheduleEnabled = false;
                }
            }
            MapUIContainer.AddSystemLog(string.Format("{0}が寝ました", (object)MapUIContainer.CharaNameColor((Actor)agent)), true);
        }
        public override void Init(UICtrl _uiCtrl, bool _tutorial)
        {
            base.Init(_uiCtrl, _tutorial);
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAdd), (Action <M0>)(_ => this.UICtrl.AddUICtrl.Active = !this.UICtrl.AddUICtrl.Active));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonUndo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Undo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonRedo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Redo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonCamera), (Action <M0>)(_ => this.Camera = !this.Camera));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAxis), (Action <M0>)(_ => this.Axis     = !this.Axis));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonGrid), (Action <M0>)(_ => this.Grid     = !this.Grid));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonSave), (Action <M0>)(_ => this.Save()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonLoad), (Action <M0>)(_ => this.UICtrl.SaveLoadUICtrl.Open()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonReset), (Action <M0>)(_ =>
            {
                ConfirmScene.Sentence     = "初期化しますか?\n" + "セットされたアイテムは削除されます。".Coloring("#DE4529FF").Size(24);
                ConfirmScene.OnClickedYes = (Action)(() =>
                {
                    this.UICtrl.ListUICtrl.VirtualizingTreeView.SelectedIndex = -1;
                    Singleton <Manager.Housing> .Instance.ResetObject();
                    this.UICtrl.ListUICtrl.UpdateUI();
                    Singleton <UndoRedoManager> .Instance.Clear();
                });
                ConfirmScene.OnClickedNo = (Action)(() => {});
                Singleton <Game> .Instance.LoadDialog();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonEnd), (Action <M0>)(_ =>
            {
                if (Singleton <CraftScene> .Instance.IsShortcutUI)
                {
                    return;
                }
                if (Singleton <CraftScene> .Instance.CraftInfo.IsOverlapNow)
                {
                    this.IsMessage = true;
                    MapUIContainer.PushMessageUI("配置に問題があるものが存在します", 2, 1, (Action)(() => this.IsMessage = false));
                }
                else
                {
                    ConfirmScene.Sentence     = "ハウジングを終了しますか?";
                    ConfirmScene.OnClickedYes = (Action)(() =>
                    {
                        Singleton <CraftScene> .Instance.SceneEnd();
                        ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (FadeType)0, 1f, true), (Action <M0>)(__ => {}), (Action)(() => this.EndHousing()));
                    });
                    ConfirmScene.OnClickedNo = (Action)(() => Singleton <CraftScene> .Instance.IsEndCheck = false);
                    Singleton <Game> .Instance.LoadDialog();
                    Singleton <CraftScene> .Instance.IsEndCheck = true;
                }
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.cameraReactive, (Action <M0>)(_b => this.spritesCamera.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonCamera).get_image().set_sprite(_s)))));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.axisReactive, (Action <M0>)(_b =>
            {
                this.spritesAxis.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonAxis).get_image().set_sprite(_s)));
                GuideObject guideObject = Singleton <GuideManager> .Instance.GuideObject;
                if (!Object.op_Implicit((Object)guideObject))
                {
                    return;
                }
                guideObject.visibleOutside = _b;
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.gridReactive, (Action <M0>)(_b =>
            {
                this.spritesGrid.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonGrid).get_image().set_sprite(_s)));
                if (!Singleton <GuideManager> .IsInstance())
                {
                    return;
                }
                Singleton <GuideManager> .Instance.VisibleGrid = _b;
            }));
            CraftCamera craftCamera = this.UICtrl.CraftCamera;

            craftCamera.NoCtrlCondition = craftCamera.NoCtrlCondition + new VirtualCameraController.NoCtrlFunc(this.NoCameraCtrl);
            if (Singleton <UndoRedoManager> .IsInstance())
            {
                Singleton <UndoRedoManager> .Instance.CanUndoChange += new EventHandler <CanhangeArgs>(this.CanUndoChange);
                Singleton <UndoRedoManager> .Instance.CanRedoChange += new EventHandler <CanhangeArgs>(this.CanRedoChange);
            }
            ((Selectable)this.buttonUndo).set_interactable(false);
            ((Selectable)this.buttonRedo).set_interactable(false);
            if (!_tutorial)
            {
                return;
            }
            ((Selectable)this.buttonSave).set_interactable(false);
            ((Selectable)this.buttonLoad).set_interactable(false);
        }
 public virtual void Start()
 {
     if (!((IEnumerable <Button>) this.btnClose).Any <Button>())
     {
         return;
     }
     ((IEnumerable <Button>) this.btnClose).Where <Button>((Func <Button, bool>)(item => Object.op_Inequality((Object)null, (Object)item))).ToList <Button>().ForEach((Action <Button>)(item => ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(item), (Action <M0>)(_ =>
     {
         if (!Object.op_Implicit((Object)this.cgbaseWindow))
         {
             return;
         }
         this.cgbaseWindow.Enable(false, false);
     }))));
 }
Beispiel #27
0
        private void SetActiveControl(bool active)
        {
            if (this._fadeDisposable != null)
            {
                this._fadeDisposable.Dispose();
            }
            IEnumerator coroutine = !active?this.CloseCoroutine() : this.OpenCoroutine();

            this._fadeDisposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.FromCoroutine((Func <IEnumerator>)(() => coroutine), false)), (Component)this);
        }
Beispiel #28
0
 public void Start()
 {
     if (this.IsStartUp)
     {
         return;
     }
     this.InitCharaList(true);
     if (Object.op_Implicit((Object)this.btnEntry))
     {
         ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnEntry), (Func <M0, bool>)(_ => !Singleton <Scene> .Instance.IsNowLoadingFade)), (Action <M0>)(_ =>
         {
             if (this.onLoadItemFunc != null)
             {
                 this.onLoadItemFunc(this.listCtrl.GetNowSelectCard());
             }
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_L);
         }));
     }
     // ISSUE: method pointer
     this.actionEntry.listActionEnter.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__2)));
     // ISSUE: method pointer
     this.actionEntry.listActionExit.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__3)));
     this.UpdateWindow(this.windowType, true, false);
     if (Object.op_Implicit((Object)this.tglMale))
     {
         ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>) this.tglMale.onValueChanged), (Func <M0, bool>)(_ => this.selectSex != 0)), (Action <M0>)(_isOn =>
         {
             if (!_isOn)
             {
                 return;
             }
             this.selectSex = 0;
             this.CreateCharaList(this.lstMaleCharaFileInfo, false);
             this.listCtrl.SetNowSelectToggle();
             if (this.listCtrl.GetNowSelectCard() != null)
             {
                 this.listCtrl.SetParameterWindowVisible(true);
             }
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_S);
         }));
         ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this.tglMale), (Action <M0>)(_ => Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Select)));
     }
     if (Object.op_Implicit((Object)this.tglFemale))
     {
         ObservableExtensions.Subscribe <bool>(Observable.Where <bool>(UnityEventExtensions.AsObservable <bool>((UnityEvent <M0>) this.tglFemale.onValueChanged), (Func <M0, bool>)(_ => this.selectSex != 1)), (Action <M0>)(_isOn =>
         {
             if (!_isOn)
             {
                 return;
             }
             this.selectSex = 1;
             this.CreateCharaList(this.lstFemaleCharaFileInfo, false);
             this.listCtrl.SetNowSelectToggle();
             if (this.listCtrl.GetNowSelectCard() != null)
             {
                 this.listCtrl.SetParameterWindowVisible(true);
             }
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_S);
         }));
         ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this.tglFemale), (Action <M0>)(_ => Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Select)));
     }
     if (Object.op_Implicit((Object)this.btnCharacterCreation))
     {
         ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnCharacterCreation), (Func <M0, bool>)(_ => !Singleton <Scene> .Instance.IsNowLoadingFade)), (Action <M0>)(_ =>
         {
             if (this.onCharaCreateClickAction != null)
             {
                 this.onCharaCreateClickAction(this.selectSex);
             }
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.OK_L);
         }));
         ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this.btnCharacterCreation), (Action <M0>)(_ => Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Select)));
         ((UnityEngine.Component) this.btnCharacterCreation).get_gameObject().SetActiveIfDifferent(!this._hideCharacterCreation);
     }
     // ISSUE: method pointer
     this.actionFemaleSelect.listActionEnter.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__D)));
     // ISSUE: method pointer
     this.actionFemaleSelect.listActionExit.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__E)));
     // ISSUE: method pointer
     this.actionMaleSelect.listActionEnter.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__F)));
     // ISSUE: method pointer
     this.actionMaleSelect.listActionExit.Add(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__10)));
     this.selectReactive = new BoolReactiveProperty(false);
     UnityUIComponentExtensions.SubscribeToInteractable((IObservable <bool>) this.selectReactive, (Selectable)this.btnEntry);
     this.listCtrl.onChangeItem = (Action <bool>)(_isOn => ((ReactiveProperty <bool>) this.selectReactive).set_Value(_isOn));
     ObservableExtensions.Subscribe <Unit>(Observable.Where <Unit>(Observable.Where <Unit>((IObservable <M0>)ObservableTriggerExtensions.UpdateAsObservable((UnityEngine.Component) this), (Func <M0, bool>)(_ => Input.GetMouseButtonUp(1))), (Func <M0, bool>)(_ => !Singleton <Scene> .Instance.IsNowLoadingFade)), (Action <M0>)(_ =>
     {
         if (this.onClickRightFunc == null)
         {
             return;
         }
         this.onClickRightFunc();
     }));
     if (Object.op_Implicit((Object)this.btnClose))
     {
         ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.btnClose), (Action <M0>)(_ =>
         {
             Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
             if (this.onCloseWindowFunc == null)
             {
                 return;
             }
             this.onCloseWindowFunc();
         }));
         ObservableExtensions.Subscribe <PointerEventData>((IObservable <M0>)ObservableTriggerExtensions.OnPointerEnterAsObservable((UIBehaviour)this.btnClose), (Action <M0>)(_ => Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Select)));
         ((UnityEngine.Component) this.btnClose).get_gameObject().SetActiveIfDifferent(!this._hideClose);
     }
     this.IsStartUp = true;
 }
Beispiel #29
0
        // 构造函数
        public MainPage()
        {
            InitializeComponent();

            IObservable <RoutedEventArgs> Observable_IP = Observable.Select <IEvent <TextChangedEventArgs>, RoutedEventArgs>
                                                          (
                Observable.FromEvent <TextChangedEventHandler, TextChangedEventArgs>
                    (h => new TextChangedEventHandler(h.Invoke), delegate(TextChangedEventHandler h)
            {
                this.tb_IP.TextChanged += h;
            }, delegate(TextChangedEventHandler h)
            {
                this.tb_IP.TextChanged -= h;
            }), evt => new RoutedEventArgs()
                                                          );

            IObservable <RoutedEventArgs> Observable_Port = Observable.Select <IEvent <TextChangedEventArgs>, RoutedEventArgs>
                                                            (
                Observable.FromEvent <TextChangedEventHandler, TextChangedEventArgs>
                    (h => new TextChangedEventHandler(h.Invoke), delegate(TextChangedEventHandler h)
            {
                this.tb_Port.TextChanged += h;
            }, delegate(TextChangedEventHandler h)
            {
                this.tb_Port.TextChanged -= h;
            }), evt => new RoutedEventArgs()
                                                            );

            IObservable <RoutedEventArgs> Observable_Name = Observable.Select <IEvent <TextChangedEventArgs>, RoutedEventArgs>
                                                            (
                Observable.FromEvent <TextChangedEventHandler, TextChangedEventArgs>
                    (h => new TextChangedEventHandler(h.Invoke), delegate(TextChangedEventHandler h)
            {
                this.tb_UserName.TextChanged += h;
            }, delegate(TextChangedEventHandler h)
            {
                this.tb_UserName.TextChanged -= h;
            }), evt => new RoutedEventArgs()
                                                            );

            IObservable <RoutedEventArgs> Observable_Password = Observable.Select <IEvent <RoutedEventArgs>, RoutedEventArgs>
                                                                (
                Observable.FromEvent <RoutedEventHandler, RoutedEventArgs>
                    (h => new RoutedEventHandler(h.Invoke), delegate(RoutedEventHandler h)
            {
                this.tb_Password.PasswordChanged += h;
            }, delegate(RoutedEventHandler h)
            {
                this.tb_Password.PasswordChanged -= h;
            }), evt => new RoutedEventArgs()
                                                                );

            IObservable <RoutedEventArgs> Observable_Anonymous_Checked = Observable.Select <IEvent <RoutedEventArgs>, RoutedEventArgs>
                                                                         (
                Observable.FromEvent <RoutedEventHandler, RoutedEventArgs>
                    (h => new RoutedEventHandler(h.Invoke), delegate(RoutedEventHandler h)
            {
                this.cb_Anonymous.Checked += h;
            }, delegate(RoutedEventHandler h)
            {
                this.cb_Anonymous.Checked -= h;
            }), evt => new RoutedEventArgs()
                                                                         );

            IObservable <RoutedEventArgs> Observable_Anonymous_Unchecked = Observable.Select <IEvent <RoutedEventArgs>, RoutedEventArgs>
                                                                           (
                Observable.FromEvent <RoutedEventHandler, RoutedEventArgs>
                    (h => new RoutedEventHandler(h.Invoke), delegate(RoutedEventHandler h)
            {
                this.cb_Anonymous.Unchecked += h;
            }, delegate(RoutedEventHandler h)
            {
                this.cb_Anonymous.Unchecked -= h;
            }), evt => new RoutedEventArgs()
                                                                           );

            ObservableExtensions.Subscribe(Observable.Select(Observable.Merge <RoutedEventArgs>(
                                                                 Observable_IP, Observable_Port, Observable_Name, Observable_Password, Observable_Anonymous_Checked, Observable_Anonymous_Unchecked),
                                                             evt => new FTPServiceLoginInfo {
                IP       = this.tb_IP.Text, Port = this.tb_Port.Text, UserName = this.tb_UserName.Text,
                Password = this.tb_Password.Password, IsAnonymous = (bool)this.cb_Anonymous.IsChecked
            }),
                                           fTPServiceLoginInfo => {
                if (!fTPServiceLoginInfo.IsAnonymous)
                {
                    btn_Login.IsEnabled = !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.IP) && !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.Port) &&
                                          !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.UserName) && !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.Password);
                }
                else
                {
                    btn_Login.IsEnabled = !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.IP) && !string.IsNullOrWhiteSpace(fTPServiceLoginInfo.Port);
                }
                tb_UserName.IsEnabled = tb_Password.IsEnabled = !fTPServiceLoginInfo.IsAnonymous;
            });
        }
Beispiel #30
0
 public void Union_SourceNull_ArgumentNullException()
 {
     ObservableExtensions.Union(null, Source);
 }