本文整理汇总了C#中Scene.Begin方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Begin方法的具体用法?C# Scene.Begin怎么用?C# Scene.Begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scene
的用法示例。
在下文中一共展示了Scene.Begin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
protected override void Update(GameTime gameTime)
{
//Calculate delta time stuff
LastTimeMult = TimeMult;
ActualDeltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds * TimeRate;
if (IsFixedTimeStep)
{
TimeMult = (60f / FRAME_RATE) * TimeRate;
DeltaTime = (1f / FRAME_RATE) * TimeRate;
}
else
{
DeltaTime = MathHelper.Clamp(
ActualDeltaTime,
FULL_DELTA * TimeRate - CLAMP_ADD,
FULL_DELTA * TimeRate + CLAMP_ADD
);
TimeMult = DeltaTime / FULL_DELTA;
}
#if DEBUG && DESKTOP
if (Commands.Open)
Input.UpdateNoKeyboard();
else
Input.Update();
#else
Input.Update();
#endif
Music.Update();
if (scene != null && scene.Active)
scene.Update();
#if DEBUG && DESKTOP
if (Commands.Open)
Commands.UpdateOpen();
else
Commands.UpdateClosed();
#endif
if (scene != nextScene)
{
if (scene != null)
scene.End();
scene = nextScene;
OnSceneTransition();
if (scene != null)
scene.Begin();
}
base.Update(gameTime);
}
示例2: Update
/// <summary>
/// Updates the Engine.
/// </summary>
protected override void Update(GameTime gameTime)
{
GameTime = gameTime;
if ( Network.IsInitialized )
Network.Update();
if (IsRunning)
{
Log.Update();
Input.Update();
if (currentScene != null && currentScene.Active)
currentScene.Update();
if (currentScene != nextScene)
{
if (currentScene != null)
currentScene.End();
currentScene = nextScene;
if (currentScene != null)
currentScene.Begin();
}
}
timeCounter += gameTime.ElapsedGameTime;
if (timeCounter >= TimeSpan.FromSeconds(1))
{
FramePerformance = frameCounter;
frameCounter = 0;
timeCounter -= TimeSpan.FromSeconds(1);
}
base.Update(gameTime);
}
示例3: Update
protected void Update(/*GameTime gameTime*/)
{
//DeltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds * TimeRate;
DeltaTime = Time.deltaTime;
//Update input
//MInput.Update();
/*if (ExitOnEscapeKeypress && MInput.Keyboard.Pressed(Microsoft.Xna.Framework.Input.Keys.Escape))
{
Exit();
return;
}*/
//Update current scene
if (FreezeTimer > 0)
FreezeTimer = Math.Max(FreezeTimer - DeltaTime, 0);
else if (scene != null)
{
scene.BeforeUpdate();
scene.Update();
scene.AfterUpdate();
}
//Debug Console
/*if (Commands.Open)
Commands.UpdateOpen();
else if (Commands.Enabled)
Commands.UpdateClosed();*/
//Changing scenes
if (scene != nextScene)
{
if (scene != null)
scene.End();
scene = nextScene;
OnSceneTransition();
if (scene != null)
scene.Begin();
}
//base.Update(gameTime);
Platformer.Draw.SpriteBatch.MoveToFront();
}
示例4: ChangeScenes
public static void ChangeScenes(Scene scene)
{
currentScene = scene;
currentScene.Begin();
}
示例5: Update
protected override void Update(GameTime gameTime)
{
DeltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds * TimeRate;
//Update input
MInput.Update();
if (ExitOnEscapeKeypress && MInput.Keyboard.Pressed(Microsoft.Xna.Framework.Input.Keys.Escape))
{
#if __IOS__
#else
Exit();
#endif
return;
}
//Update current scene
if (FreezeTimer > 0)
FreezeTimer = Math.Max(FreezeTimer - DeltaTime, 0);
else if (scene != null)
{
scene.BeforeUpdate();
scene.Update();
scene.AfterUpdate();
}
//Debug Console
if (Commands.Open)
Commands.UpdateOpen();
else if (Commands.Enabled)
Commands.UpdateClosed();
//Changing scenes
if (scene != nextScene)
{
if (scene != null)
scene.End();
scene = nextScene;
OnSceneTransition();
if (scene != null)
scene.Begin();
}
base.Update(gameTime);
}
示例6: ChangeScenes
public static void ChangeScenes(Scene scene)
{
if (CurrentScene != null) {
CurrentScene.End ();
}
CurrentScene = scene;
CurrentScene.Begin ();
}