当前位置: 首页>>代码示例>>C#>>正文


C# Scene.Begin方法代码示例

本文整理汇总了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);
        }
开发者ID:saint11,项目名称:oldskull,代码行数:53,代码来源:Engine.cs

示例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);
        }
开发者ID:BeauPrime,项目名称:Networking,代码行数:39,代码来源:Engine.cs

示例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();
        }
开发者ID:tanis2000,项目名称:Futile,代码行数:44,代码来源:Engine.cs

示例4: ChangeScenes

 public static void ChangeScenes(Scene scene)
 {
     currentScene = scene;
     currentScene.Begin();
 }
开发者ID:RossAllenBell,项目名称:touchonauts,代码行数:5,代码来源:Main.cs

示例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);
        }
开发者ID:tanis2000,项目名称:MonoGameBunnyMark,代码行数:45,代码来源:Engine.cs

示例6: ChangeScenes

 public static void ChangeScenes(Scene scene)
 {
     if (CurrentScene != null) {
         CurrentScene.End ();
     }
     CurrentScene = scene;
     CurrentScene.Begin ();
 }
开发者ID:RossAllenBell,项目名称:samurai-fortress-defense,代码行数:8,代码来源:Main.cs


注:本文中的Scene.Begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。