Пример #1
0
 /// <summary>
 /// Initialize the input mapper
 /// </summary>
 private void InitializeMapper()
 {
     this._actionMapper = new InputActionMapper <MainMenuAction>(this.Input,
                                                                 new InputAction <MainMenuAction>(MainMenuAction.MenuUp, KeyPressType.Down, Key.Up),
                                                                 new InputAction <MainMenuAction>(MainMenuAction.MenuDown, KeyPressType.Down, Key.Down),
                                                                 new InputAction <MainMenuAction>(MainMenuAction.MenuSelect, KeyPressType.Pressed, Key.Enter),
                                                                 new InputAction <MainMenuAction>(MainMenuAction.Exit, KeyPressType.Pressed, Key.Escape),
                                                                 new InputAction <MainMenuAction>(MainMenuAction.Exit, KeyPressType.Down, Key.Q, Key.ShiftLeft)
                                                                 );
 }
Пример #2
0
 private void InitializeMapper()
 {
     this._actionMapper = new InputActionMapper <MapViewerAction>(this.Input,
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveUp, KeyPressType.Down, Key.Up),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveDown, KeyPressType.Down, Key.Down),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveLeft, KeyPressType.Down, Key.Left),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveRight, KeyPressType.Down, Key.Right),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveUpFast, KeyPressType.Down, Key.Up, Key.ShiftLeft),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveDownFast, KeyPressType.Down, Key.Down, Key.ShiftLeft),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveLeftFast, KeyPressType.Down, Key.Left, Key.ShiftLeft),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.MoveRightFast, KeyPressType.Down, Key.Right, Key.ShiftLeft),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.RegenerateMap, KeyPressType.Pressed, Key.R),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowMap, KeyPressType.Pressed, Key.M),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowRainfall, KeyPressType.Pressed, Key.F),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowDrainage, KeyPressType.Pressed, Key.D),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowTemperature, KeyPressType.Pressed, Key.T),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowInfluence, KeyPressType.Pressed, Key.I),
                                                                  new InputAction <MapViewerAction>(MapViewerAction.ShowResources, KeyPressType.Down, Key.R, Key.ShiftLeft)
                                                                  );
 }
Пример #3
0
 /// <summary>
 /// Initialize the input mapper
 /// </summary>
 private void InitializeMapper()
 {
     this._actionMapper = new InputActionMapper <WorldGenAction>(this.Input,
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveUp, KeyPressType.Down, Key.Up),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveDown, KeyPressType.Down, Key.Down),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveLeft, KeyPressType.Down, Key.Left),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveRight, KeyPressType.Down, Key.Right),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveUpFast, KeyPressType.Down, Key.Up, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveDownFast, KeyPressType.Down, Key.Down, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveLeftFast, KeyPressType.Down, Key.Left, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.MoveRightFast, KeyPressType.Down, Key.Right, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.RegenerateMap, KeyPressType.Pressed, Key.R),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ShowMap, KeyPressType.Pressed, Key.M),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ShowRainfall, KeyPressType.Pressed, Key.F),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ShowDrainage, KeyPressType.Pressed, Key.D),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ShowTemperature, KeyPressType.Pressed, Key.T),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.SaveWorld, KeyPressType.Pressed, Key.U),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ShowResources, KeyPressType.Down, Key.R, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.ToggleFogOfWar, KeyPressType.Down, Key.F, Key.ShiftLeft),
                                                                 new InputAction <WorldGenAction>(WorldGenAction.Cancel, KeyPressType.Down, Key.Q, Key.ShiftLeft)
                                                                 );
 }
Пример #4
0
 private void Awake()
 {
     arrowLayer = LayerMask.NameToLayer("Arrow");
     input      = GetComponentInParent <InputActionMapper>();
 }