所以我有这个代码:变量:
enum gameState
{
gameLoading,
mainMenu,
gameOptions,
levelSelect,
gamePlaying,
gameOver
}
在Update()
方法中:
if (CurrentGameState == gameState.gameLoading)
{
if (Keyboard.GetState().IsKeyDown(Keys.E))
{
graphics.ToggleFullScreen(); //?
}
graphics.ApplyChanges();
}
...
//gameState.gameLoading logic
if (Keyboard.GetState().IsKeyDown(Keys.Enter))
CurrentGameState = gameState.mainMenu;
所以我想要的是按下 EntergameState.gameLoading
并且两个分辨率都是全屏的并且gameState
等于mainMenu
. 当gameState.mainMenu
分辨率无法通过按 Enter 键从全屏更改为窗口时。如何做到这一点?也许使用列表?