public ControlMap RegisterDefaultControls(ControlMap _Controls) { //Debug.Log("Resetting Controls"); _Controls.Clear(); _Controls.RegisterKey("Ability", KeyCode.Space); _Controls.RegisterKey("Up", KeyCode.W); _Controls.RegisterKey("Down", KeyCode.S); _Controls.RegisterKey("Left", KeyCode.A); _Controls.RegisterKey("Right", KeyCode.D); _Controls.RegisterKey("Percise Move", KeyCode.LeftShift); _Controls.RegisterKey("Pause", KeyCode.Escape); _Controls.RegisterKey("Cancel", KeyCode.Escape); _Controls.RegisterKey("Toggle Editor", KeyCode.E); _Controls.RegisterKey("Advance", KeyCode.Space); return(_Controls); }
void ListenToKeys() { Event cur = Event.current; if (cur.isKey) { KeyCode curKey = cur.keyCode; if (curKey == KeyCode.None) { Screen.lockCursor = false; _listeningTo = -1; return; } _setControls.RegisterKey(_setControls.controlNames[_listeningTo], curKey); _listeningTo = -1; Screen.lockCursor = false; } }
public ControlMap RegisterDefaultControls(ControlMap _Controls) { Debug.Log("Resetting Controls"); _Controls.Clear(); _Controls.RegisterKey("Accelerate", KeyCode.W); _Controls.RegisterKey("Deccelerate", KeyCode.S); _Controls.RegisterKey("SteerLeft", KeyCode.A); _Controls.RegisterKey("SteerRight", KeyCode.D); _Controls.RegisterKey("RollLeft", KeyCode.Q); _Controls.RegisterKey("RollRight", KeyCode.E); _Controls.RegisterKey("Respawn", KeyCode.R); _Controls.RegisterKey("PowerControl", KeyCode.LeftShift); _Controls.RegisterKey("UseAbility", KeyCode.Space); _Controls.RegisterKey("LookBack", KeyCode.Tab); _Controls.RegisterKey("ToggleScreenLock", KeyCode.Escape); _Controls.RegisterKey("TargetingMode", KeyCode.Mouse1); _Controls.RegisterKey("ChangeShip", KeyCode.C); _Controls.RegisterKey("ActivateSheild", KeyCode.LeftControl); return _Controls; }