Commit dbd5de72 by Philipp Adolf

Add alternate arrows input mapping

parent 6af717c6
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using GamepadInput; using GamepadInput;
public enum controlType : int { WASD = 0, ARROWS = 1, GAMEPAD1 = 2, GAMEPAD2 = 3, GAMEPAD3 = 4, GAMEPAD4 = 5 } public enum controlType : int { WASD = 0, ARROWS = 1, ARROWS2 = 6, GAMEPAD1 = 2, GAMEPAD2 = 3, GAMEPAD3 = 4, GAMEPAD4 = 5 }
public class PlayerInputMapping : MonoBehaviour public class PlayerInputMapping : MonoBehaviour
{ {
...@@ -40,6 +40,18 @@ public class PlayerInputMapping : MonoBehaviour ...@@ -40,6 +40,18 @@ public class PlayerInputMapping : MonoBehaviour
keyCodes[(int)Keys.Dash] = KeyCode.Backslash; keyCodes[(int)Keys.Dash] = KeyCode.Backslash;
keyCodes[(int)Keys.Shoot] = KeyCode.RightBracket; keyCodes[(int)Keys.Shoot] = KeyCode.RightBracket;
break; break;
case controlType.ARROWS2:
usesGamepad = false;
keyCodes[(int)Keys.Right] = KeyCode.RightArrow;
keyCodes[(int)Keys.Left] = KeyCode.LeftArrow;
keyCodes[(int)Keys.Up] = KeyCode.UpArrow;
keyCodes[(int)Keys.Jump] = keyCodes[(int)Keys.Up];
keyCodes[(int)Keys.Down] = KeyCode.DownArrow;
keyCodes[(int)Keys.Dash] = KeyCode.Hash;
keyCodes[(int)Keys.Shoot] = KeyCode.Plus;
break;
case controlType.GAMEPAD1: case controlType.GAMEPAD1:
gamepadIndex = GamePad.Index.One; gamepadIndex = GamePad.Index.One;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment