public void AddInputEvent(keyCodeIndex index) { InputEvent.Axis a = InputEvent.Axis.Null; float val = 0; if (index == keyCodeIndex.Brake) { a = InputEvent.Axis.Throttle; val = -1; } else if (index == keyCodeIndex.Speed) { a = InputEvent.Axis.Throttle; val = 1; } else if (index == keyCodeIndex.Powerup) { a = InputEvent.Axis.Powerup; val = 1; } else if (index == keyCodeIndex.Left) { a = InputEvent.Axis.Direction; val = -1; } else if (index == keyCodeIndex.Right) { a = InputEvent.Axis.Direction; val = 1; } if (a == InputEvent.Axis.Null) { return; } inputEvents.AddLast(new InputEvent(a, val)); }
public void AddInputEvent(keyCodeIndex index) { InputEvent.Axis a = InputEvent.Axis.Null; float val=0; if(index == keyCodeIndex.Brake) { a = InputEvent.Axis.Throttle; val = -1; } else if(index == keyCodeIndex.Speed) { a = InputEvent.Axis.Throttle; val = 1; } else if(index == keyCodeIndex.Powerup) { a = InputEvent.Axis.Powerup; val = 1; } else if(index == keyCodeIndex.Left) { a = InputEvent.Axis.Direction; val = -1; } else if(index == keyCodeIndex.Right) { a = InputEvent.Axis.Direction; val = 1; } if(a == InputEvent.Axis.Null) { return; } inputEvents.AddLast(new InputEvent(a,val)); }