コード例 #1
0
        private void DebugAxis(PS4.AxisName axisName)
        {
            var axis = PS4.GetAxis(axisName);

            if (axis > 0.1f || axis < -0.1f)
            {
                Debug.Log(axisName.ToString() + " : " + axis);
            }
        }
コード例 #2
0
        protected override void Update()
        {
            base.Update();

            thirdPersonCamera.SetEulerX(PS4.GetAxis(PS4.AxisName.AnalogRight_Y) * thirdPersonCamera.rotationSpeed * Time.deltaTime);
            thirdPersonCamera.SetEulerY(PS4.GetAxis(PS4.AxisName.AnalogRight_X) * thirdPersonCamera.rotationSpeed * Time.deltaTime);

            DoMovementControl();
            MovePathTrail(analogLeft, isAnalogLeftMoved);

            equipHolster.DoEquipHolster(PS4.ButtonName.Square);
        }
コード例 #3
0
        private void DoMovementControl()
        {
            if (!isAbleToMove)
            {
                return;
            }

            var analogLeftX = PS4.GetAxis(PS4.AxisName.AnalogLeft_X);
            var analogLeftY = PS4.GetAxis(PS4.AxisName.AnalogLeft_Y);

            if (analogLeftX == 0 && analogLeftY == 0)
            {
                animParam.isLeftAnalogMoving = false;
                return;
            }

            animParam.isLeftAnalogMoving = true;

            var camdir = camDir;

            camdir.y = 0;

            analogLeft.rotation = Quaternion.LookRotation(camdir);
            analogLeft.position = playerPos + (analogLeft.forward * analogLeftY) + (analogLeft.right * analogLeftX);

            animParam.AnalogLeftX = analogLeft.localPosition.x;
            animParam.AnalogLeftY = analogLeft.localPosition.z;

            if (!animParam.isMoving && distanceFromFurthestTail > 3)
            {
                switch (animationState)
                {
                case AnimationState.RunAnimsetBasic:
                    Move_RunAnimsetBasic(GetMovingDirection_RunAnimsetBasic());
                    break;

                case AnimationState.SwordAnimsetPro:
                    Move_SwordAnimsetPro(GetMovingDirection_SwordAnimsetPro());
                    break;

                case AnimationState.LongswordAnimsetPro:
                    Move_LongswordAnimsetPro(GetMovingDirection_RunAnimsetBasic());
                    break;
                }

                animParam.isMoving = true;
            }

            RotateTowardTrail(analogLeft);
        }