Example #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;
            }
        }
Example #2
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);
                }));
            }
        }