public void AddKeyboard2Controller() { Dictionary <KeyboardController.eSimulatedAxis, string> axis = new Dictionary <KeyboardController.eSimulatedAxis, string>(); Dictionary <KeyboardController.eKeyboardButtonId, string> buttons = new Dictionary <KeyboardController.eKeyboardButtonId, string>(); axis.Add(KeyboardController.eSimulatedAxis.UP_LEFT_JOYSTICK, "up"); axis.Add(KeyboardController.eSimulatedAxis.LEFT_LEFT_JOYSTICK, "left"); axis.Add(KeyboardController.eSimulatedAxis.DOWN_LEFT_JOYSTICK, "down"); axis.Add(KeyboardController.eSimulatedAxis.RIGHT_LEFT_JOYSTICK, "right"); buttons.Add(KeyboardController.eKeyboardButtonId.ACTION, "return"); KeyboardController controller = new KeyboardController(axis, buttons); m_Keyboard2ControllerId = ControllerInputManager.Instance.AddController(controller); }
public ControllerInputManager.eControllerId AddController(BaseController controller) { // Save the detected controller. if (controller != null && (m_Controllers.Count + 1) < System.Enum.GetNames(typeof(eControllerId)).Length) { // First item starts at 1. eControllerId controllerId = (eControllerId)(m_Controllers.Count + 1); controller.SetKeyMapping(); controller.ControllerId = controllerId; m_Controllers.Add(controllerId, controller); Debug.Log(controllerId.ToString() + " uses " + controller.GetType().Name + ": " + GetControllerDetectionName(controller.GetType())); return(controllerId); } return(eControllerId.NONE); }
public void AddKeyboard1Controller() { Dictionary<KeyboardController.eSimulatedAxis, string> axis = new Dictionary<KeyboardController.eSimulatedAxis, string>(); Dictionary<KeyboardController.eKeyboardButtonId, string> buttons = new Dictionary<KeyboardController.eKeyboardButtonId, string>(); axis.Add(KeyboardController.eSimulatedAxis.UP_LEFT_JOYSTICK, "w"); axis.Add(KeyboardController.eSimulatedAxis.LEFT_LEFT_JOYSTICK, "a"); axis.Add(KeyboardController.eSimulatedAxis.DOWN_LEFT_JOYSTICK, "s"); axis.Add(KeyboardController.eSimulatedAxis.RIGHT_LEFT_JOYSTICK, "d"); axis.Add(KeyboardController.eSimulatedAxis.UP_RIGHT_JOYSTICK, "up"); axis.Add(KeyboardController.eSimulatedAxis.LEFT_RIGHT_JOYSTICK, "left"); axis.Add(KeyboardController.eSimulatedAxis.DOWN_RIGHT_JOYSTICK, "down"); axis.Add(KeyboardController.eSimulatedAxis.RIGHT_RIGHT_JOYSTICK, "right"); buttons.Add(KeyboardController.eKeyboardButtonId.ACTION, "space"); buttons.Add(KeyboardController.eKeyboardButtonId.L1, "space"); buttons.Add(KeyboardController.eKeyboardButtonId.R1, "return"); KeyboardController controller = new KeyboardController(axis, buttons); m_Keyboard1ControllerId = ControllerInputManager.Instance.AddController(controller); }
public void AddMouseController() { MouseController controller = new MouseController(); m_MouseControllerId = ControllerInputManager.Instance.AddController(controller); }
public void AddMouseController() { MouseController controller = new MouseController(); m_MouseControllerId = ControllerInputManager.Instance.AddController(controller); }