-
Notifications
You must be signed in to change notification settings - Fork 88
Runtime Input
Cristian Geambasu edited this page Apr 5, 2018
·
2 revisions
private void CreateKeyboardScheme()
{
InputManager.CreateControlScheme("MyKeyboardScheme");
InputManager.CreateDigitalAxis("MyKeyboardScheme", "Horizontal", KeyCode.D, KeyCode.A, 3.0f, 3.0f);
InputManager.CreateDigitalAxis("MyKeyboardScheme", "Vertical", KeyCode.W, KeyCode.S, 3.0f, 3.0f);
InputManager.CreateButton("MyKeyboardScheme", "Jump", KeyCode.Space);
InputManager.SetControlScheme("MyKeyboardScheme", PlayerID.One);
}
private void CreateJoystickConfiguration()
{
InputManager.CreateControlScheme("MyJoystickScheme");
InputManager.CreateAnalogAxis("MyJoystickScheme", "Horizontal", 0, 0, 1.0f, 0.1f);
InputManager.CreateAnalogAxis("MyJoystickScheme", "Vertical", 0, 1, 1.0f, 0.1f);
InputManager.CreateButton("MyJoystickScheme", "Jump", KeyCode.JoystickButton0);
InputManager.SetControlScheme("MyJoystickScheme", PlayerID.One);
}
InputManager.CreateButton and InputManager.CreateDigitalAxis have overloads that take secondary keys.