本文整理汇总了C#中IScene.LoadContent方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.LoadContent方法的具体用法?C# IScene.LoadContent怎么用?C# IScene.LoadContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.LoadContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(GameTime gameTime)
{
if (currentScene == null)
{
if (sceneQueue.Count > 0)
{
currentScene = sceneQueue.Dequeue();
currentScene.LoadContent(GameService.GetService<ContentManager>());
}
else return;
}
currentScene.Update(gameTime);
}
示例2: setScene
public void setScene(IScene scene)
{
var oldScene = currentScene;
// some day might do loading indicator... now just display empty screen
currentScene = null;
oldScene.UnloadContent(this);
scene.LoadContent(this);
currentScene = scene;
}
示例3: CreateScene
//--------------------------------------//
// 関数名 CreateScene //
// Function name CreateScene
// 機能 予約されたシーンを作成 //
// Create a scene that has been reserved function
// 引数 なし //
// No argument
// 戻り値 なし //
// No return value
//--------------------------------------//
public void CreateScene()
{
// Delete the current scene
currentScene = null;
// Create a scene that is reserved
switch (nextScene)
{
// Sample scene
case SCENE_TYPE.SAMPLE_SCENE1:
currentScene = new SampleScene1();
break;
// Sample Scene 2
case SCENE_TYPE.MAIN_MENU_SCENE:
currentScene = new MainMenu();
break;
case SCENE_TYPE.TITLE_SCENE:
currentScene = new TitleScene();
break;
}
// I to the scene without reservation the following
nextScene = SCENE_TYPE.NONE;
// I call the initialization processing of the scene that contains new
currentScene.Initialize();
// I call the processing load of the scene that contains new
currentScene.LoadContent(this.content);
}