コード例 #1
0
        /// <summary>
        /// Update the joystick info.
        /// </summary>
        private void GetJoystickInfo()
        {
            // check if any joystick connected.
            if (!JCS_Input.IsJoystickConnected())
            {
                return;
            }

            for (int index = 0; index < mTotalGamePadInGame; ++index)
            {
                JoystickMap joystickMap = GetJoysitckMapByIndex(index);

                // get stick value.
                joystickMap.stickLeftXVal = JCS_Input.GetAxis(index, JCS_JoystickButton.STICK_LEFT_X);
                joystickMap.stickLeftYVal = JCS_Input.GetAxis(index, JCS_JoystickButton.STICK_LEFT_Y);

                joystickMap.stickRightXVal = JCS_Input.GetAxis(index, JCS_JoystickButton.STICK_RIGHT_X);
                joystickMap.stickRightYVal = JCS_Input.GetAxis(index, JCS_JoystickButton.STICK_RIGHT_Y);
            }
        }