コード例 #1
0
ファイル: FirstPersonExample.cs プロジェクト: sora929/TSC
        // FixedUpdate
        void FixedUpdate()
        {
            if (axesInputType == AxesInputType.BindAxes && !binded)
            {
                TCKInput.BindAxes("Joystick", BindPlayerAxes);
                binded = true;
                return;
            }

            if (axesInputType != AxesInputType.BindAxes && binded)
            {
                TCKInput.UnbindAxes("Joystick", BindPlayerAxes);
                binded = false;
                return;
            }

            if (axesInputType != AxesInputType.GetAxis)
            {
                return;
            }

            float moveX = TCKInput.GetAxis("Joystick", EAxisType.Horizontal);
            float moveY = TCKInput.GetAxis("Joystick", EAxisType.Vertical);

            PlayerMovement(moveX, moveY);
        }
コード例 #2
0
        // FixedUpdate
        void FixedUpdate()
        {
            if (axesInputType == AxesInputType.BindAxes && !binded)
            {
                TCKInput.BindAxes("Joystick", BindPlayerAxes);
                binded = true;
                return;
            }

            if (axesInputType != AxesInputType.BindAxes && binded)
            {
                TCKInput.UnBindAxes("Joystick", BindPlayerAxes);
                binded = false;
                return;
            }


            if (axesInputType != AxesInputType.GetAxis)
            {
                return;
            }

            if (axesGetType == GetAxesMethod.GetByName)
            {
                float moveX = TCKInput.GetAxis("Joystick", "Horizontal");
                float moveY = TCKInput.GetAxis("Joystick", "Vertical");
                PlayerMovement(moveX, moveY);
            }
            else
            {
                float moveX = TCKInput.GetAxis("Joystick", AxisType.X);
                float moveY = TCKInput.GetAxis("Joystick", AxisType.Y);
                PlayerMovement(moveX, moveY);
            }
        }