예제 #1
0
        private void LookAtPlayer()
        {
            if (!this.isLooking)
            {
                return;
            }
            PlayerActor player = this.Player;

            this.distanceToPlayer = Vector3.Distance(player.Position, this.Merchant.Position);
            if (this.IsCloseToPlayer && !this.isNearPlayer)
            {
                Transform  trfTarg    = player.FovTargetPointTable.get_Item(Actor.FovBodyPart.Head);
                ChaControl chaControl = this.Merchant.ChaControl;
                chaControl.ChangeLookEyesTarget(1, trfTarg, 0.5f, 0.0f, 1f, 2f);
                chaControl.ChangeLookEyesPtn(1);
                chaControl.ChangeLookNeckTarget(1, trfTarg, 0.5f, 0.0f, 1f, 0.8f);
                chaControl.ChangeLookNeckPtn(1, 1f);
                this.isNearPlayer = true;
            }
            else
            {
                if (!this.IsFarPlayer || !this.isNearPlayer)
                {
                    return;
                }
                ChaControl chaControl = this.Merchant.ChaControl;
                chaControl.ChangeLookEyesPtn(3);
                chaControl.ChangeLookNeckPtn(3, 1f);
                this.isNearPlayer = false;
            }
        }
예제 #2
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            this.counter = 0.0f;
            this.Merchant.ActivateNavMeshObstacle(this.Merchant.Position);
            this.prevTalkable = this.Merchant.Talkable;
            if (!this.prevTalkable)
            {
                this.Merchant.Talkable = true;
            }
            this._player = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player;

            this._merchant = this.Merchant;
            ChaControl chaControl = this.Merchant.ChaControl;

            chaControl.ChangeLookNeckTarget(1, this._player.FovTargetPointTable.get_Item(Actor.FovBodyPart.Head), 0.5f, 0.0f, 1f, 0.8f);
            chaControl.ChangeLookNeckPtn(1, 1f);
        }
예제 #3
0
        protected override void OnAwake(PlayerActor player)
        {
            this._player   = player;
            this._agent    = Singleton <Manager.Map> .Instance.TutorialAgent;
            this._isFinish = false;
            if (Object.op_Equality((Object)this._player, (Object)null) || Object.op_Equality((Object)this._agent, (Object)null))
            {
                Debug.LogError((object)"OpeningWakeUp: プレイヤー キャラが空っぽなのはおかしい");
            }
            else
            {
                AgentProfile agentProfile = Singleton <Resources> .Instance.AgentProfile;
                CommonDefine commonDefine = Singleton <Resources> .Instance.CommonDefine;
                Resources.AnimationTables    animation = Singleton <Resources> .Instance.Animation;
                CommonDefine.TutorialSetting setting   = commonDefine.Tutorial;
                player.ChaControl.visibleAll = false;
                this._agent.ChangeTutorialBehavior(AIProject.Definitions.Tutorial.ActionType.Idle);
                player.EventKey = (AIProject.EventType) 0;
                this._fadeEnd   = false;
                int        personality = this._agent.ChaControl.fileParam.personality;
                ChaControl chaControl1 = this._agent.ChaControl;
                chaControl1.ChangeLookEyesPtn(0);
                chaControl1.ChangeLookNeckPtn(3, 1f);
                PoseKeyPair pose;
                PlayState   playState;
                this.TryGetWakeUpAnimState(personality, out pose, out playState);
                MapUIContainer.SetVisibleHUD(false);
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.UI);

                Singleton <Manager.Input> .Instance.SetupState();

                // ISSUE: cast to a reference type
                // ISSUE: explicit reference operation
                this._prevStyle = (CinemachineBlendDefinition.Style)(^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style;
                // ISSUE: cast to a reference type
                // ISSUE: explicit reference operation
                (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)0;
                this._eventCamera = player.CameraControl.EventCamera;
                ((Component)this._eventCamera).get_transform().SetParent(player.CameraControl.EventCameraParent, false);
                ((Component)this._eventCamera).get_transform().set_localPosition(Vector3.get_zero());
                ((Component)this._eventCamera).get_transform().set_localRotation(Quaternion.Euler(0.0f, 180f, 0.0f));
                Animator eventCameraLocator            = player.CameraControl.EventCameraLocator;
                RuntimeAnimatorController itemAnimator = animation.GetItemAnimator(commonDefine.ItemAnims.OpeningWakeUpCameraAnimatorID);
                eventCameraLocator.set_runtimeAnimatorController(itemAnimator);
                ((Component)eventCameraLocator).get_transform().set_position(this._agent.Position);
                ((Component)eventCameraLocator).get_transform().set_rotation(this._agent.Rotation);
                eventCameraLocator.set_speed(0.0f);
                float  shapeBodyValue      = this._agent.ChaControl.GetShapeBodyValue(0);
                string heightParameterName = Singleton <Resources> .Instance.DefinePack.AnimatorParameter.HeightParameterName;
                eventCameraLocator.SetFloat(heightParameterName, shapeBodyValue);
                player.CameraControl.Mode = CameraMode.Event;
                this._agent.Animation.LoadEventKeyTable(pose.postureID, pose.poseID);
                this._agent.Animation.InitializeStates(playState);
                this._agent.LoadEventItems(playState);
                this._agent.Animation.StopAllAnimCoroutine();
                this._agent.Animation.PlayInAnimation(playState.MainStateInfo.InStateInfo.EnableFade, playState.MainStateInfo.InStateInfo.FadeSecond, playState.MainStateInfo.FadeOutTime, playState.Layer);
                this.PlayCameraAnimation(eventCameraLocator, personality);
                Transform  transform   = ((Component)player.CameraControl.CameraComponent).get_transform();
                ChaControl chaControl2 = this._agent.ChaControl;
                chaControl2.ChangeLookEyesTarget(1, transform, 0.5f, 0.0f, 1f, 2f);
                chaControl2.ChangeLookEyesPtn(1);
                this._fadeTimerDisposable = ObservableExtensions.Subscribe <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds((double)setting.OpeningWakeUpStartFadeTime)), (Component)player), (System.Action <M0>)(_ =>
                {
                    if (Singleton <Sound> .IsInstance())
                    {
                        Singleton <Sound> .Instance.StopBGM(setting.OpeningWakeUpFadeTime);
                    }
                    this._fadeTimerDisposable = ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)1, setting.OpeningWakeUpFadeTime, false), (System.Action <M0>)(__ => {}), (System.Action)(() => this._fadeEnd = true));
                }));
                ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (System.Action <M0>)(_ =>
                {
                    this._isFinish = true;
                    this.Elapsed(player);
                }));
            }
        }
        private void Start()
        {
            this._charaRoot = new GameObject("root_Chara").get_transform();
            foreach (TestChara chara in this._charaList)
            {
                if (Object.op_Inequality((Object)chara, (Object)null))
                {
                    ChaControl chaControl = chara.Sex != (byte)0 ? Singleton <Character> .Instance.CreateChara((byte)1, ((Component)this._charaRoot).get_gameObject(), 0, (ChaFileControl)null) : Singleton <Character> .Instance.CreateChara((byte)0, ((Component)this._charaRoot).get_gameObject(), 0, (ChaFileControl)null);

                    chaControl.Load(false);
                    chaControl.ChangeLookEyesPtn(3);
                    chaControl.ChangeLookNeckPtn(3, 1f);
                    MatchTargetWeightMaskTester weightMaskTester = (MatchTargetWeightMaskTester)((Component)chaControl.animBody).get_gameObject().AddComponent <MatchTargetWeightMaskTester>();
                    weightMaskTester.Animator = chaControl.animBody;
                    weightMaskTester.Animator.set_runtimeAnimatorController(chara.Rac);
                    weightMaskTester.StateName = ((ReactiveProperty <string>) this._stateName).get_Value();
                    weightMaskTester.Targets   = new MatchTargetWeightMaskTester.TargetParameter[this._targets.Length];
                    for (int index = 0; index < this._targets.Length; ++index)
                    {
                        MatchTargetWeightMaskTester.TargetParameter targetParameter = weightMaskTester.Targets[index] ?? (weightMaskTester.Targets[index] = new MatchTargetWeightMaskTester.TargetParameter());
                        targetParameter.Start  = this._targets[index].Start;
                        targetParameter.End    = this._targets[index].End;
                        targetParameter.Target = this._targets[index].Target;
                    }
                    weightMaskTester.PositionWeight = ((ReactiveProperty <Vector3>) this._positionWeight).get_Value();
                    weightMaskTester.RotationWeight = ((ReactiveProperty <float>) this._rotationWeight).get_Value();
                    this._chaCtrlList.Add(chaControl);
                    this._testScripts.Add(weightMaskTester);
                }
            }
            ObservableExtensions.Subscribe <string>((IObservable <M0>) this._stateName, (Action <M0>)(x =>
            {
                if (!Object.op_Inequality((Object)this._stateNameInput, (Object)null))
                {
                    return;
                }
                this._stateNameInput.set_text(x);
            }));
            ObservableExtensions.Subscribe <Vector3>((IObservable <M0>) this._positionWeight, (Action <M0>)(x =>
            {
                foreach (MatchTargetWeightMaskTester testScript in this._testScripts)
                {
                    if (Object.op_Inequality((Object)testScript, (Object)null))
                    {
                        testScript.PositionWeight = x;
                    }
                }
            }));
            ObservableExtensions.Subscribe <float>((IObservable <M0>) this._rotationWeight, (Action <M0>)(x =>
            {
                foreach (MatchTargetWeightMaskTester testScript in this._testScripts)
                {
                    if (Object.op_Inequality((Object)testScript, (Object)null))
                    {
                        testScript.RotationWeight = x;
                    }
                }
            }));
            if (Object.op_Inequality((Object)this._stateNameInput, (Object)null))
            {
                this._stateNameInput.set_text(((ReactiveProperty <string>) this._stateName).get_Value());
                // ISSUE: method pointer
                ((UnityEvent <string>) this._stateNameInput.get_onValueChanged()).AddListener(new UnityAction <string>((object)this, __methodptr(\u003CStart\u003Em__3)));
            }
            if (Object.op_Inequality((Object)this._button, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)this._button.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__4)));
            }
            else
            {
                Debug.LogError((object)"ボタン(UI)が未設定", (Object)this);
            }
            if (Object.op_Inequality((Object)this._addButton, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)this._addButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__5)));
            }
            if (!Object.op_Inequality((Object)this._subButton, (Object)null))
            {
                return;
            }
            // ISSUE: method pointer
            ((UnityEvent)this._subButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__6)));
        }