本文整理汇总了C#中IGameMode.LoadContent方法的典型用法代码示例。如果您正苦于以下问题:C# IGameMode.LoadContent方法的具体用法?C# IGameMode.LoadContent怎么用?C# IGameMode.LoadContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGameMode
的用法示例。
在下文中一共展示了IGameMode.LoadContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameMode
/// <summary>
/// Switch between the different GameStates and update the current GameMode
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
private void GameMode(GameTime gameTime)
{
switch(State) {
case GameState.StartUp:
if(!(gameMode is StartUp)) {
gameMode = startUp;
}
gameMode.Update(gameTime);
break;
case GameState.InGame:
if(!(gameMode is InGame)) {
inGame = new InGame(this);
gameMode = inGame;
gameMode.LoadContent(this.Content);
}
gameMode.Update(gameTime);
break;
case GameState.JoinGame:
if(PlayerName == "" || !Regex.IsMatch(PlayerName, @"^[a-zA-Z0-9]{3,12}$")) {
this.SetName();
break;
}
if(!(gameMode is JoinGame)) {
joinGame = new JoinGame(this);
gameMode = joinGame;
gameMode.LoadContent(this.Content);
}
gameMode.Update(gameTime);
break;
case GameState.CreateGame:
if(PlayerName == "" || !Regex.IsMatch(PlayerName, @"^[a-zA-Z0-9]{3,12}$")) {
this.SetName();
break;
}
if(!(gameMode is CreateGame)) {
createGame = new CreateGame(this);
gameMode = createGame;
gameMode.LoadContent(this.Content);
}
gameMode.Update(gameTime);
break;
case GameState.Exit:
this.Exit();
break;
}
}
示例2: ChangeGameMode
public void ChangeGameMode(IGameMode gameMode)
{
m_currentGameMode = gameMode;
m_currentGameMode.Initialize();
m_currentGameMode.LoadContent();
}