本文整理汇总了C#中GameManager.ChangeScreen方法的典型用法代码示例。如果您正苦于以下问题:C# GameManager.ChangeScreen方法的具体用法?C# GameManager.ChangeScreen怎么用?C# GameManager.ChangeScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameManager
的用法示例。
在下文中一共展示了GameManager.ChangeScreen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartMenuScreen
public StartMenuScreen(GameManager gameManager)
: base(gameManager)
{
var menuItems = new List<MenuItem>
{
new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")),
new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen")),
new MenuItem(Strings.HIGH_SCORES, LinkType.Transition, () => gameManager.ChangeScreen("HighScoresScreen")),
};
_menu = new Menu(gameManager, menuItems);
}
示例2: HighScoresScreen
public HighScoresScreen(GameManager gameManager)
: base(gameManager)
{
_highScores = new ImageFile { Text = Strings.HIGH_SCORES, Scale = new Vector2(2f, 2f) };
_menu = new Menu(gameManager, new[]
{
new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")),
new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen"))
});
_scoresImageFiles = new List<ImageFile>();
}
示例3: GameOverScreen
public GameOverScreen(GameManager gameManager)
: base(gameManager)
{
_menu = new Menu(gameManager, new[]
{
new MenuItem(Strings.UPLOAD_SCORE, LinkType.Switch, UploadGameScore),
new MenuItem(Strings.HIGH_SCORES, LinkType.Transition, () => gameManager.ChangeScreen("HighScoresScreen")),
new MenuItem(Strings.NEW_GAME, LinkType.Transition, () => gameManager.ChangeScreen("DemoLevelScreen")),
new MenuItem(Strings.OPTIONS, LinkType.Transition, () => gameManager.ChangeScreen("OptionsMenuScreen")),
});
_gameOver = new ImageFile { Text = Strings.GAME_OVER, Scale = new Vector2(2f, 2f) };
_score = new ImageFile { Text = String.Format("{0}: {1}", Strings.YOUR_SCORE, gameManager.PlayerStats.CurrentScore) };
_highScore = new ImageFile { Text = String.Format("{0}: {1}", Strings.YOUR_HIGH_SCORE, gameManager.PlayerStats.HighScore) };
}
示例4: OptionsMenuScreen
public OptionsMenuScreen(GameManager gameManager)
: base(gameManager)
{
_gameManager = gameManager;
var sound = gameManager.SoundManager.EffectsOn ? Strings.ON : Strings.OFF;
var music = gameManager.SoundManager.MusicOn ? Strings.ON : Strings.OFF;
_soundMenuItem = new MenuItem(String.Format("{0}: {1}", Strings.SOUND, sound), LinkType.Switch, SwitchSoundEffects);
_musicMenuItem = new MenuItem(String.Format("{0}: {1}", Strings.MUSIC, music), LinkType.Switch, SwitchMusic);
var menuItems = new List<MenuItem>
{
_soundMenuItem,
_musicMenuItem,
new MenuItem(Strings.BACK, LinkType.Transition, () => gameManager.ChangeScreen("StartMenuScreen")),
};
_menu = new Menu(gameManager, menuItems);
}