コード例 #1
0
ファイル: Normal.cs プロジェクト: request-time-out/A-Scripts
        protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
        {
            Singleton <Manager.Map> .Instance.CheckStoryProgress();

            if (actor == null)
            {
                return;
            }
            Input       instance    = Singleton <Input> .Instance;
            PlayerActor playerActor = actor;

            if (instance.State == Input.ValidType.Action)
            {
                Transform  transform = ((Component)playerActor.CameraControl).get_transform();
                Vector2    moveAxis  = instance.MoveAxis;
                Quaternion rotation  = transform.get_rotation();
                Vector3    vector3   = Quaternion.op_Multiply(Quaternion.Euler(0.0f, (float)((Quaternion) ref rotation).get_eulerAngles().y, 0.0f), Vector3.ClampMagnitude(new Vector3((float)moveAxis.x, 0.0f, (float)moveAxis.y), 1f));
                info.move    = vector3;
                info.lookPos = Vector3.op_Addition(((Component)actor).get_transform().get_position(), Vector3.op_Multiply(transform.get_forward(), 100f));
                StuffItem equipedLampItem = playerActor.PlayerData.EquipedLampItem;
                if (Mathf.Approximately(((Vector2) ref moveAxis).get_sqrMagnitude(), 0.0f) && (equipedLampItem == null || !Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.ContainsLightItem(equipedLampItem)))
                {
                    this._elapsedTimeOnLeft += Time.get_deltaTime();
                    if ((double)this._elapsedTimeOnLeft <= (double)Singleton <Resources> .Instance.LocomotionProfile.TimeToLeftState)
                    {
                        return;
                    }
                    playerActor.Controller.ChangeState("Houchi");
                }
                else
                {
                    this._elapsedTimeOnLeft = 0.0f;
                }
            }
コード例 #2
0
        protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
        {
            Singleton <Manager.Map> .Instance.CheckStoryProgress();

            Vector2 moveAxis = Singleton <Input> .Instance.MoveAxis;

            if (Math.Sqrt((double)(moveAxis.x * moveAxis.x + moveAxis.y * moveAxis.y)) > 0.5)
            {
                this._onEndInput.OnNext(Unit.get_Default());
            }
            if (actor.Animation.PlayingInLocoAnimation || actor.Animation.PlayingActAnimation)
            {
                return;
            }
            AnimatorStateInfo animatorStateInfo = actor.Animation.Animator.GetCurrentAnimatorStateInfo(0);

            if (!((AnimatorStateInfo) ref animatorStateInfo).IsName(this._loopStateName) || (double)(((AnimatorStateInfo) ref animatorStateInfo).get_normalizedTime() - this._oldNormalizedTime) <= 1.0)
            {
                return;
            }
            this._oldNormalizedTime = ((AnimatorStateInfo) ref animatorStateInfo).get_normalizedTime();
            if (Random.Range(0, this._randomCount) != 0)
            {
                return;
            }
            actor.Animation.PlayActionAnimation(actor.Animation.AnimInfo.layer);
            this._oldNormalizedTime = 0.0f;
        }
コード例 #3
0
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (actor.Animation.PlayingInLocoAnimation)
     {
         return;
     }
     if (this._onEndInAnimation != null)
     {
         this._onEndInAnimation.OnNext(Unit.get_Default());
     }
     if (MapUIContainer.SystemMenuUI.IsActiveControl)
     {
         return;
     }
     this._onEndMenu.OnNext(Unit.get_Default());
     if (actor.Animation.PlayingOutAnimation)
     {
         Vector2 moveAxis = Singleton <Input> .Instance.MoveAxis;
         if ((double)Mathf.Sqrt((float)(moveAxis.x * moveAxis.x + moveAxis.y * moveAxis.y)) <= 0.5)
         {
             return;
         }
         this._onEndInput.OnNext(Unit.get_Default());
     }
     else
     {
         this._onEndInput.OnNext(Unit.get_Default());
     }
 }
コード例 #4
0
ファイル: Sleep.cs プロジェクト: request-time-out/A-Scripts
 protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
 {
     player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (MapUIContainer.CommandList.IsActiveControl || player.ProcessingTimeSkip)
     {
         return;
     }
     if (this._onEndAction != null)
     {
         this._onEndAction.OnNext(Unit.get_Default());
     }
     if (player.Animation.PlayingInAnimation)
     {
         Vector2 moveAxis = Singleton <Manager.Input> .Instance.MoveAxis;
         if ((double)Mathf.Sqrt((float)(moveAxis.x * moveAxis.x + moveAxis.y * moveAxis.y)) <= 0.5)
         {
             return;
         }
         this._onEndInAnim.OnNext(Unit.get_Default());
     }
     else
     {
         if (this._onEndInAnim == null)
         {
             return;
         }
         this._onEndInAnim.OnNext(Unit.get_Default());
     }
 }
コード例 #5
0
 protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
 {
     if (this._isFinish || !this._fadeEnd || (MapUIContainer.FadeCanvas.IsFadeIn || this.PlayingCameraAnimation) || (this._agent.Animation.PlayingInAnimation || this._onEndAction == null))
     {
         return;
     }
     this._onEndAction.OnNext(Unit.get_Default());
 }
コード例 #6
0
 public override void Update(Actor actor, ref Actor.InputInfo info)
 {
     if (!(actor is PlayerActor))
     {
         return;
     }
     this.OnUpdate(actor as PlayerActor, ref info);
 }
コード例 #7
0
 public override void AfterUpdate(Actor actor, Actor.InputInfo info)
 {
     if (!(actor is PlayerActor))
     {
         return;
     }
     this.OnAfterUpdate(actor as PlayerActor, info);
 }
コード例 #8
0
 protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
 {
     player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (MapUIContainer.FadeCanvas.IsFadeIn || !this._completeWait || (MapUIContainer.FadeCanvas.IsFadeOut || this._onEndAction == null))
     {
         return;
     }
     this._onEndAction.OnNext(Unit.get_Default());
 }
コード例 #9
0
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (Object.op_Inequality((Object)this._doorAnimation, (Object)null) && this._doorAnimation.PlayingCloseAnim || this._onEndAction == null)
     {
         return;
     }
     this._onEndAction.OnNext(Unit.get_Default());
 }
コード例 #10
0
 protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
 {
     player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (MapUIContainer.PlayerLookEditUI.IsActiveControl)
     {
         return;
     }
     this._onEndMenu.OnNext(Unit.get_Default());
 }
コード例 #11
0
ファイル: Onbu.cs プロジェクト: request-time-out/A-Scripts
        protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
        {
            Singleton <Manager.Map> .Instance.CheckStoryProgress();

            if (actor.Animation.PlayingInLocoAnimation)
            {
                return;
            }
            this._onEndInAnimation.OnNext(Unit.get_Default());
            Manager.Input instance    = Singleton <Manager.Input> .Instance;
            PlayerActor   playerActor = actor;

            if (instance.State == Manager.Input.ValidType.Action)
            {
                Transform  transform = ((Component)playerActor.CameraControl).get_transform();
                Vector2    moveAxis  = instance.MoveAxis;
                Quaternion rotation  = transform.get_rotation();
                Vector3    vector3   = Quaternion.op_Multiply(Quaternion.Euler(0.0f, (float)((Quaternion) ref rotation).get_eulerAngles().y, 0.0f), Vector3.ClampMagnitude(new Vector3((float)moveAxis.x, 0.0f, (float)moveAxis.y), 1f));
                info.move = vector3;
                if (UnityEngine.Input.GetKeyDown((KeyCode)325) || UnityEngine.Input.GetKeyDown((KeyCode)282))
                {
                    playerActor.PlayerController.ChangeState("Menu");
                }
                else
                {
                    if (!UnityEngine.Input.GetKeyDown((KeyCode)109))
                    {
                        return;
                    }
                    if (Singleton <MapUIContainer> .Instance.MinimapUI.VisibleMode == 0)
                    {
                        playerActor.Controller.ChangeState("WMap");
                    }
                    else
                    {
                        if (Singleton <MapUIContainer> .Instance.MinimapUI.VisibleMode != 2)
                        {
                            return;
                        }
                        if (Manager.Config.GameData.MiniMap)
                        {
                            Singleton <MapUIContainer> .Instance.MinimapUI.OpenMiniMap();
                        }
                        else
                        {
                            playerActor.Controller.ChangeState("WMap");
                        }
                    }
                }
            }
            else
            {
                info.move = Vector3.get_zero();
                Transform transform = ((Component)playerActor.CameraControl).get_transform();
                info.lookPos = Vector3.op_Addition(((Component)actor).get_transform().get_position(), Vector3.op_Multiply(transform.get_forward(), 100f));
            }
        }
コード例 #12
0
ファイル: Onbu.cs プロジェクト: request-time-out/A-Scripts
 protected override void OnFixedUpdate(PlayerActor player, Actor.InputInfo info)
 {
     if (player.Animation.PlayingInLocoAnimation)
     {
         return;
     }
     this._layer = Singleton <Resources> .Instance.DefinePack.MapDefines.HLayer;
     this._tag   = Singleton <Resources> .Instance.DefinePack.MapDefines.OnbuMeshTag;
     Vector3     position = player.Position;
     ref Vector3 local    = ref position;
コード例 #13
0
ファイル: Photo.cs プロジェクト: request-time-out/A-Scripts
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            if (!this._updatable || !Singleton <Input> .IsInstance() || (!Singleton <Resources> .IsInstance() || !Singleton <Game> .IsInstance()) || Object.op_Inequality((Object)Singleton <Game> .Instance.MapShortcutUI, (Object)null))
            {
                return;
            }
            float             deltaTime         = Time.get_deltaTime();
            Input             instance          = Singleton <Input> .Instance;
            LocomotionProfile locomotionProfile = Singleton <Resources> .Instance.LocomotionProfile;

            LocomotionProfile.PhotoShotSetting photoShot          = locomotionProfile.PhotoShot;
            LocomotionProfile.LensSettings     defaultLensSetting = locomotionProfile.DefaultLensSetting;
            float num1 = instance.ScrollValue();
            float num2 = (float)(((double)num1 + (double)this._prevScrollValue) / 2.0);

            this._prevScrollValue = num1;
            Transform  transform = ((Component)this._actorCamera).get_transform();
            Vector2    moveAxis  = instance.MoveAxis;
            Quaternion rotation  = transform.get_rotation();
            Vector3    vector3   = Quaternion.op_Multiply(Quaternion.Euler(0.0f, (float)((Quaternion) ref rotation).get_eulerAngles().y, 0.0f), Vector3.ClampMagnitude(new Vector3((float)moveAxis.x, 0.0f, (float)moveAxis.y), 1f));

            info.move    = vector3;
            info.lookPos = Vector3.op_Addition(((Component)player).get_transform().get_position(), Vector3.op_Multiply(transform.get_forward(), 100f));
            if (instance.IsPressedKey((KeyCode)324))
            {
                this._onEndAction.OnNext(Unit.get_Default());
            }
            else
            {
                if (instance.IsPressedKey((KeyCode)325))
                {
                    this.PlaySE(SoundPack.SystemSE.Photo);
                    this._actorCamera.ScreenShot.Capture(string.Empty);
                }
                if (!Mathf.Approximately(num2, 0.0f))
                {
                    float       num3  = num2 * photoShot.mouseZoomScale * deltaTime;
                    ref Vector3 local = ref this._offset;
                    local.z = (__Null)(local.z + (double)num3 * (!this._reversi ? 1.0 : -1.0));
                }
                if (Object.op_Inequality((Object)this._followRoot, (Object)null) && Object.op_Inequality((Object)this._camera, (Object)null))
                {
                    Vector3 offsetMoveValue = photoShot.offsetMoveValue;
                    Vector3 maxOffset       = photoShot.maxOffset;
                    Vector3 minOffset       = photoShot.minOffset;
                    if (Input.GetKey((KeyCode)273))
                    {
                        ref Vector3 local = ref this._offset;
                        local.y = (__Null)(local.y + offsetMoveValue.y * (double)deltaTime);
                    }
                    if (Input.GetKey((KeyCode)274))
                    {
                        ref Vector3 local = ref this._offset;
                        local.y = (__Null)(local.y - offsetMoveValue.y * (double)deltaTime);
                    }
コード例 #14
0
 public override void Awake(Actor actor)
 {
     Actor.InputInfo stateInfo = actor.StateInfo;
     stateInfo.move  = Vector3.get_zero();
     actor.StateInfo = stateInfo;
     if (!(actor is PlayerActor))
     {
         return;
     }
     this.OnAwake(actor as PlayerActor);
 }
コード例 #15
0
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     this.dt += Time.get_unscaledDeltaTime();
     if ((double)this.dt < 0.400000005960464 || !this.input.IsPressedKey((KeyCode)109) || this.minimapUI.nowCloseAllMap)
     {
         return;
     }
     this.minimapUI.ChangeCamera(false, false);
     this.minimapUI.WarpMoveDispose();
 }
コード例 #16
0
ファイル: Fishing.cs プロジェクト: request-time-out/A-Scripts
        protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
        {
            if (!this.initFlag)
            {
                return;
            }
            Input instance = Singleton <Input> .Instance;

            this.inputFlag = false;
            this.HorizontalUpdate(instance);
            this.UpdateRodAngle();
            actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
        }
コード例 #17
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
            if (MapUIContainer.FadeCanvas.IsFadeIn || !this._completeWait || MapUIContainer.FadeCanvas.IsFadeOut)
            {
                return;
            }
            DevicePoint currentDevicePoint = player.CurrentDevicePoint;

            if (Object.op_Inequality((Object)this._agent, (Object)null) && (this._agent.Animation.PlayingInLocoAnimation || currentDevicePoint.PlayingInAnimation || this.PlayingCameraAnimation) || this._onEndAction == null)
            {
                return;
            }
            this._onEndAction.OnNext(Unit.get_Default());
        }
コード例 #18
0
ファイル: Move.cs プロジェクト: request-time-out/A-Scripts
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     if (actor.Animation.PlayingInAnimation)
     {
         return;
     }
     if (this._onEndAction != null)
     {
         this._onEndAction.OnNext(Unit.get_Default());
     }
     if (actor.Animation.PlayingOutAnimation)
     {
         return;
     }
     this.Elapsed(actor);
 }
コード例 #19
0
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     if (actor.Animation.PlayingInAnimation)
     {
         return;
     }
     if (this._onEndAction != null)
     {
         this._onEndAction.OnNext(Unit.get_Default());
     }
     if (actor.Animation.PlayingOutAnimation)
     {
         return;
     }
     this.Elapsed(actor);
 }
コード例 #20
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
            if (player.Animation.PlayingInAnimation)
            {
                return;
            }
            AnimatorStateInfo animatorStateInfo = player.Animation.Animator.GetCurrentAnimatorStateInfo(0);

            if (!((AnimatorStateInfo) ref animatorStateInfo).IsName(this._loopStateName))
            {
                return;
            }
            this._elapsedTime += Time.get_deltaTime();
            if ((double)this._elapsedTime <= (double)Singleton <Resources> .Instance.LocomotionProfile.TimeToLeftState)
            {
                ;
            }
        }
コード例 #21
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
            if (player.Animation.PlayingInAnimation)
            {
                return;
            }
            if (this._onEndAction != null)
            {
                this._onEndAction.OnNext(Unit.get_Default());
            }
            if (player.Animation.PlayingOutAnimation)
            {
                return;
            }
            bool?nullable = this._animData != null ? new bool?(this._animData.PlayingAnimation) : new bool?();

            if ((!nullable.HasValue ? 0 : (nullable.Value ? 1 : 0)) != 0 || this._onComplete == null)
            {
                return;
            }
            this._onComplete.OnNext(Unit.get_Default());
        }
コード例 #22
0
        protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
        {
            info.move = Vector3.get_zero();
            if (this.isEnd)
            {
                return;
            }
            if (this.isCameraBlend)
            {
                this.isCameraBlend = actor.CameraControl.CinemachineBrain.get_IsBlending();
                if (this.isCameraBlend)
                {
                    return;
                }
            }
            bool?nullable = this.isWait != null ? new bool?(this.isWait(actor)) : new bool?();

            if ((!nullable.HasValue ? 0 : (nullable.Value ? 1 : 0)) != 0 || this.onEndAction == null)
            {
                return;
            }
            this.onEndAction.OnNext(Unit.get_Default());
        }
コード例 #23
0
 protected override void OnAfterUpdate(PlayerActor player, Actor.InputInfo info)
 {
     player.CharacterTPS.UpdateState(info, ActorLocomotion.UpdateType.Update);
 }
コード例 #24
0
 protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
 {
     player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
 }
コード例 #25
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            AgentActor agentPartner = player.AgentPartner;

            if (Object.op_Equality((Object)agentPartner, (Object)null))
            {
                return;
            }
            AgentProfile      agentProfile      = Singleton <Resources> .Instance.AgentProfile;
            LocomotionProfile locomotionProfile = Singleton <Resources> .Instance.LocomotionProfile;
            NavMeshAgent      navMeshAgent1     = player.NavMeshAgent;

            if (navMeshAgent1.get_isOnOffMeshLink())
            {
                this.Stop(player);
                OffMeshLinkData currentOffMeshLinkData1 = navMeshAgent1.get_currentOffMeshLinkData();
                if (!Object.op_Inequality((Object)((OffMeshLinkData) ref currentOffMeshLinkData1).get_offMeshLink(), (Object)null))
                {
                    return;
                }
                NavMeshAgent navMeshAgent2 = player.NavMeshAgent;
                M0           m0;
                if (navMeshAgent2 == null)
                {
                    m0 = (M0)null;
                }
                else
                {
                    OffMeshLinkData currentOffMeshLinkData2 = navMeshAgent2.get_currentOffMeshLinkData();
                    m0 = ((Component)((OffMeshLinkData) ref currentOffMeshLinkData2).get_offMeshLink())?.GetComponent <ActionPoint>();
                }
                ActionPoint point = (ActionPoint)m0;
                if (!Object.op_Inequality((Object)point, (Object)null) || !point.OffMeshAvailablePoint((Actor)player))
                {
                    return;
                }
                if (point is DoorPoint)
                {
                    player.CurrentPoint = point;
                    player.PlayerController.ChangeState("DoorOpen", point, (Action)null);
                }
                else
                {
                    player.CurrentPoint = point;
                    player.PlayerController.ChangeState("Move", point, (Action)null);
                }
            }
            else
            {
                Vector3 destination = this.DesiredPosition((Actor)agentPartner);
                if ((double)Vector3.Distance(destination, player.Position) >= (double)agentProfile.RestDistance)
                {
                    this.SetDestination(player, destination);
                    this._moved = true;
                }
                else
                {
                    NavMeshPathStatus pathStatus = navMeshAgent1.get_pathStatus();
                    if (pathStatus == 1 || pathStatus == 2)
                    {
                        if ((double)Vector3.Distance(player.Position, agentPartner.Position) >= (double)agentProfile.RestDistance)
                        {
                            return;
                        }
                        this.Stop(player);
                        if (!player.IsRunning)
                        {
                            return;
                        }
                        player.IsRunning = false;
                    }
                    else
                    {
                        if (navMeshAgent1.get_pathPending())
                        {
                            return;
                        }
                        if ((double)navMeshAgent1.get_remainingDistance() < (double)agentProfile.RestDistance && player.IsRunning)
                        {
                            player.IsRunning = false;
                        }
                        if (!this._moved || (double)navMeshAgent1.get_remainingDistance() >= (double)navMeshAgent1.get_stoppingDistance())
                        {
                            return;
                        }
                        this.Stop(player);
                        this._moved = false;
                    }
                }
            }
        }
コード例 #26
0
 protected virtual void OnAfterUpdate(PlayerActor player, Actor.InputInfo info)
 {
 }
コード例 #27
0
 protected abstract void OnUpdate(PlayerActor player, ref Actor.InputInfo info);
コード例 #28
0
 protected override void OnUpdate(PlayerActor actor, ref Actor.InputInfo info)
 {
     actor.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
     this.OnEndInAnimation();
     this.OnEndMenu();
 }