コード例 #1
0
 /// <summary>
 /// Sets each key to player prefs or preset default
 /// </summary>
 /// <param name="preset"></param>
 public void Set(JoypadPreset preset)
 {
     Map = new ButtonMap
     {
         { "jump", preset.jumpKey },
         { "attack", preset.attackKey },
         { "magic", preset.magicKey },
         { "item", preset.itemKey },
         { "menu", preset.menuKey },
         { "menuConfirm", preset.menuConfirmKey },
         { "menuCancel", preset.menuCancelKey },
         { "menuExit", preset.menuExitKey },
         { "up", preset.upKey },
         { "down", preset.downKey },
         { "left", preset.leftKey },
         { "right", preset.rightKey }
     };
 }
コード例 #2
0
 /// <summary>
 /// Sets each key to the player prefs or default
 /// </summary>
 public void Set()
 {
     Map = new ButtonMap
     {
         { "jump", KeyCode.Space.ToString() },
         { "attack", KeyCode.Return.ToString() },
         { "magic", KeyCode.M.ToString() },
         { "item", KeyCode.RightShift.ToString() },
         { "menu", KeyCode.Escape.ToString() },
         { "menuConfirm", KeyCode.Space.ToString() },
         { "menuCancel", KeyCode.Backspace.ToString() },
         { "menuExit", KeyCode.Escape.ToString() },
         { "up", KeyCode.W.ToString() },
         { "down", KeyCode.S.ToString() },
         { "left", KeyCode.A.ToString() },
         { "right", KeyCode.D.ToString() }
     };
 }