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


C# Game.Exit方法代码示例

本文整理汇总了C#中SiliconStudio.Xenko.Engine.Game.Exit方法的典型用法代码示例。如果您正苦于以下问题:C# Game.Exit方法的具体用法?C# Game.Exit怎么用?C# Game.Exit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SiliconStudio.Xenko.Engine.Game的用法示例。


在下文中一共展示了Game.Exit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestLocalizationCoherencyLoopImpl

        private void TestLocalizationCoherencyLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            // useless motion on the root entities just to check that is does not disturb to calculations.
            rootSubEntity1.Transform.Position += new Vector3(1, 2, 3);
            listCompEntities[0].Transform.Position += new Vector3(3, 2, -1);
            // have the emitter turn clockwise around the listener.
            emitCompEntities[0].Transform.Position = new Vector3((float)Math.Cos(loopCount * Math.PI / 100), 0, (float)Math.Sin(loopCount * Math.PI / 100));

            // the sound should turn around clockwise 
            if (loopCount == 800)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:14,代码来源:TestAudioSystem.cs

示例2: TestDopplerCoherencyLoopImpl

        private void TestDopplerCoherencyLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            // useless motion on the root entities just to check that is does not disturb to calculations.
            rootSubEntity1.Transform.Position += new Vector3(1, 2, 3);
            listCompEntities[0].Transform.Position += new Vector3(3, 2, -1);
            // apply a left to right motion to the emitter entity
            emitCompEntities[0].Transform.Position = new Vector3(20*(loopCount-200), 0, 2);

            // the sound should be modified in pitch depending on which side the emitter is
            // ( first pitch should be increased and then decreased)
            if (loopCount == 400)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:15,代码来源:TestAudioSystem.cs

示例3: TestAttenuationCoherencyLoopImpl

        private void TestAttenuationCoherencyLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            // put away progressively the emitter.
            emitCompEntities[0].Transform.Position = new Vector3(0, 0, loopCount / 10f);

            // the sound should progressively attenuate
            if (loopCount == 800)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:11,代码来源:TestAudioSystem.cs

示例4: TestEffectsAndMusicLoopImpl

 private void TestEffectsAndMusicLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         // start the sound music in background.
         var music = game.Asset.Load<SoundMusic>("MusicFishLampMp3");
         music.Play();
     }
     // here we should hear the mp3.
     else if (loopCount == 240)
     {
         // check that AudioEmitterComponent can be played along with soundMusic.
         soundControllers[0].Play();
     }
     // here we should hear the soundEffect 0 and the mp3.
     else if (loopCount == 260)
     {
         // check that two AudioEmitterComponent can be played along with a soundMusic.
         soundControllers[2].Play();
     }
     // here we should hear the soundEffect 0 and 2 and the mp3.
     else if (loopCount == 500)
     {
         game.Exit();
     }
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:26,代码来源:TestAudioSystem.cs

示例5: TestSeveralControllersLoopImpl

        private void TestSeveralControllersLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            // have the emitter turn around the listener to check that all sounds are coming from the same emitter.
            emitCompEntities[0].Transform.Position = new Vector3((float)Math.Cos(loopCount * Math.PI / 30), 0, (float)Math.Sin(loopCount * Math.PI / 30));

            if (loopCount == 0)
            {
                // start a first controller
                soundControllers[0].Play();
            }
            // here we should hear SoundEffect 0
            else if (loopCount == 30)
            {
                // start a second controller while controller 1 has not finished to play
                soundControllers[1].Play();
            }
            // here we should hear SoundEffect 0 and 1
            else if (loopCount == 60)
            {
                // start a third controller while controller 2 has not finished to play
                soundControllers[3].Play();
            }
            // here we should hear the soundEffect 1 and 2
            else if (loopCount == 120)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:28,代码来源:TestAudioSystem.cs

示例6: TestRemoveListenerLoopImpl

 private void TestRemoveListenerLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         // check that initially the sound are hear via the two listeners.
         soundControllers[0].Play();
         soundControllers[2].Play();
     }
     // here we should hear the soundEffect 0 on left ear and the soundEffect 2 on right ear
     else if (loopCount == 60)
     {
         // remove listener 3 from the entity system => check that the sounds are now heard only via listener 1
         throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
         //game.Entities.Remove(listCompEntities[2]);
     }
     // here we should hear the soundEffect 0 on left ear only
     else if (loopCount == 120)
     {
         // remove listener 1 from the audio system  => check that the sounds are not outputted anymore.
         game.Audio.RemoveListener(listComps[0]);
     }
     // here we should hear nothing.
     else if (loopCount == 180)
     {
         game.Exit();
     }
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:27,代码来源:TestAudioSystem.cs

示例7: TestAddRemoveEmitterLoopImpl

        private void TestAddRemoveEmitterLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            if (loopCount == 0)
            {
                // check there is no sound output if the emitterComponents are not added to the entity system.
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear nothing.
            else if (loopCount == 60)
            {
                // add emitter 1 to the entity system
                throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Add(emitCompEntities[0]);

                // check that emitter 1 can now be heard.
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear the soundEffect 0 on left ear only
            else if (loopCount == 120)
            {
                // add now emitter 2 to the entity system
                throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Add(emitCompEntities[1]);

                // test that now both emitters can be heard.
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear the soundEffect 0 on left ear and the soundEffect 2 on right ear
            else if (loopCount == 180)
            {
                // remove emitter 2 from the entity system  
                throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Remove(emitCompEntities[1]);

                // test that now only emitter 1 can be heard.
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear the soundEffect 0 on left ear only
            else if (loopCount == 240)
            {
                // remove emitter 1 from the entity system  
                throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Remove(emitCompEntities[0]);

                // check that there is not more audio output at all
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear nothing.
            else if (loopCount == 320)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:58,代码来源:TestAudioSystem.cs

示例8: TestExitLoopLoopImpl

 private void TestExitLoopLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         mainController.Play();
     }
     // should hear the beginning of the sound
     else if (loopCount == 10)
     {
         // test a basic utilisation of exitLoop.
         mainController.ExitLoop();
     }
     // should hear the end of the sound
     else if (loopCount == 60)
     {
         Assert.IsTrue(mainController.IsLooped, "The value of isLooped has been modified by ExitLoop.");
         Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "The sound did not stopped after exitloop.");
     }
     // should hear nothing
     else if (loopCount == 80)
     {
         // check that performing an exitLoop before the play commit does not fail (bfr next AudioSystem.Uptade).
         mainController.Play();
         mainController.ExitLoop();
     }
     // should hear a sound not looped
     else if (loopCount == 140)
     {
         Assert.IsTrue(mainController.IsLooped, "The value of isLooped has been modified by ExitLoop just after play.");
         Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "The sound did not stopped after Exitloop just after play.");
     }
     // should hear nothing
     else if (loopCount == 160)
     {
         mainController.Play();
     }
     // should hear the beginning of the sound
     else if (loopCount == 170)
     {
         // check that performing an ExitLoop while the sound is paused does not fails.
         mainController.Pause();
         mainController.ExitLoop();
     }
     // should hear nothing
     else if (loopCount == 220)
     {
         mainController.Play();
     }
     // should hear the end of the sound (not looped)
     else if (loopCount == 270)
     {
         Assert.IsTrue(mainController.IsLooped, "The value of isLooped has been modified by ExitLoop after pause.");
         Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "The sound did not stopped after exitloop after pause.");
     }
     // should hear nothing
     else if (loopCount == 320)
     {
         // check that performing an exitLoop while the sound is stopped is ignored.
         mainController.ExitLoop();
         mainController.Play();
     }
     // should hear the sound looping
     else if (loopCount == 500)
     {
         Assert.IsTrue(mainController.IsLooped, "The value of isLooped has been modified by ExitLoop before play.");
         Assert.AreEqual(SoundPlayState.Playing, mainController.PlayState, "The sound did not looped.");
         game.Exit();
     }
 }
开发者ID:cg123,项目名称:xenko,代码行数:69,代码来源:TestController.cs

示例9: TestAddListenerLoopImpl

        private void TestAddListenerLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            if (loopCount == 0)
            {
                // check that a controller play call output nothing if there is no listener currently listening.
                soundControllers[0].Play();
            }
            // nothing should come out from the speakers during this gap
            else if(loopCount == 60)
            {
                // check that the sound is correctly outputted when there is one listener
                game.Audio.AddListener(listComps[0]);
                soundControllers[0].Play();
            }
            // here we should hear soundEffect 0
            else if (loopCount == 120)
            {
                // isolate the two listeners such that emitter 1 can be heard only by listener 1 and emitter 2 by listener 2
                // and place emitters such that emitters 1 output on left ear and emitter 2 on right ear.
                listCompEntities[0].Transform.Position = listCompEntities[0].Transform.Position - new Vector3(1000, 0, 0);
                emitCompEntities[0].Transform.Position = emitCompEntities[0].Transform.Position - new Vector3(1, 0, 0);
                emitCompEntities[1].Transform.Position = emitCompEntities[1].Transform.Position + new Vector3(1, 0, 0);

                // add a new listener not present into the entity system yet to the audio system
                listComps.Add(new AudioListenerComponent());
                listCompEntities.Add(new Entity());
                listCompEntities[2].Add(listComps[2]);
                game.Audio.AddListener(listComps[2]);

                // check that the sound is not heard by the new listener (because not added to the entity system).
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear the soundEffect 0 on left ear only
            else if(loopCount == 180)
            {
                // add the new listener to the entity system
                throw new NotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Add(listCompEntities[2]);

                // check the sounds are heard by the two listeners.
                soundControllers[0].Play();
                soundControllers[2].Play();
            }
            // here we should hear the soundEffect 0 on left ear and the soundEffect 2 on right ear
            else if(loopCount > 240)
            {
                game.Exit();
            }
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:50,代码来源:TestAudioSystem.cs

示例10: TestStopLoopImpl

 private void TestStopLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         // check that a call to stop works even though the call to play has not been comitted yet (next AudioSystem.Update).
         soundControllers[2].Play();
         soundControllers[2].Stop();
     }
     // should hear nothing
     else if (loopCount == 60)
     {
         Assert.AreEqual(SoundPlayState.Stopped, soundControllers[2].PlayState, "The sound play status was not stopped just after play.");
         soundControllers[2].Play();
     }
     // should hear the beginning of the sound
     else if (loopCount == 150)
     {
         // test the basic call to stop.
         soundControllers[2].Stop();
         Assert.AreEqual(SoundPlayState.Stopped, soundControllers[2].PlayState, "The sound play status was not stopped.");
     }
     // should hear nothing
     else if (loopCount == 200)
     {
         soundControllers[2].Play();
     }
     // should hear the beginning of the sound
     else if (loopCount == 400)
     {
         game.Exit();
     }
 }
开发者ID:cg123,项目名称:xenko,代码行数:32,代码来源:TestController.cs

示例11: TestPlayStateLoopImpl

 private void TestPlayStateLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 60)
     {
         // check that PlayState is automatically reset to 'Stopped' when all the subInstances have finished to play.
         Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "Value of playState with listeners is not valid after the end of the track.");
         game.Exit();
     }
 }
开发者ID:cg123,项目名称:xenko,代码行数:9,代码来源:TestController.cs

示例12: TestPlayLoopImpl

        private void TestPlayLoopImpl(Game game, int loopCount, int loopCountSum)
        {
            if (loopCount == 0)
            {
                // test that the sound does not play when playing a sound associated to an entity which has not been added to the system yet.
                mainController.Play();
            }
            // should hear nothing
            else if (loopCount == 100)
            {
                Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "The sound play status was playing eventhough the entity was not added.");

                // check the behavious of a basic call to play.
                AddRootEntityToEntitySystem(game);
                mainController.Play();
            }
            // should hear the beginning of the sound
            else if (loopCount == 120)
            {
                Assert.AreEqual(SoundPlayState.Playing, mainController.PlayState, "The sound play status was not playing eventhough the entity was added.");
            }
            // should hear the end of the sound
            else if (loopCount == 160)
            {
                // add a longuer sound
                sounds.Add(game.Content.Load<SoundEffect>("EffectFishLamp"));
                emitComps[0].AttachSoundEffect(sounds[2]);
                soundControllers.Add(emitComps[0].GetSoundEffectController(sounds[2]));
                soundControllers[2].Play();
            }
            // should hear the beginning of the sound
            else if (loopCount == 300)
            {
                // check that the sound is stopped when removing the listeners.
                game.Audio.RemoveListener(listComps[0]);
                game.Audio.RemoveListener(listComps[1]);
                Assert.AreEqual(SoundPlayState.Stopped, soundControllers[2].PlayState, "The sound has not been stopped when the listeners have been removed.");
            }
            // should hear nothing
            else if (loopCount == 360)
            {
                game.Audio.AddListener(listComps[0]);
                game.Audio.AddListener(listComps[1]);
                soundControllers[2].Play();
            }
            // should hear the beginning of the sound
            else if (loopCount == 500)
            {
                // check that the sound is stopped when removing the sound Entity from the system.
                Internal.Refactor.ThrowNotImplementedException("TODO: UPDATE TO USE Scene and Graphics Composer"); 
                //game.Entities.Remove(rootEntity);
                Assert.AreEqual(SoundPlayState.Stopped, soundControllers[2].PlayState, "The sound has not been stopped when the emitter's entities have been removed.");
            }
            // should hear nothing
            else if (loopCount == 560)
            {
                game.Exit();
            }
        }
开发者ID:cg123,项目名称:xenko,代码行数:59,代码来源:TestController.cs

示例13: TestIsLoopedLoopImpl

 private void TestIsLoopedLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         // check that the sound loops as it should.
         mainController.IsLooped = true;
         mainController.Play();
     }
     // should hear looped sound
     else if (loopCount == 100)
     {
         Assert.AreEqual(SoundPlayState.Playing, mainController.PlayState, "The sound play status was stopped but the sound is supposed to be looped.");
         mainController.Stop();
     }
     // should hear nothing
     else if (loopCount == 150)
     {
         // check that the sound does not loop  as it should.
         mainController.IsLooped = false;
         mainController.Play();
     }
     // should hear not a looped sound
     else if (loopCount == 250)
     {
         Assert.AreEqual(SoundPlayState.Stopped, mainController.PlayState, "The sound play status was playing but the sound is supposed to do so.");
         mainController.Stop();
     }
     // should hear not a looped sound
     else if (loopCount == 300)
     {
         // check that setting the isLooped without listener works too
         game.Audio.RemoveListener(listComps[0]);
         game.Audio.RemoveListener(listComps[1]);
         mainController.IsLooped = true;
         game.Audio.AddListener(listComps[0]);
         game.Audio.AddListener(listComps[1]);
         mainController.Play();
     }
     // should hear looped sound
     else if (loopCount == 400)
     {
         Assert.AreEqual(SoundPlayState.Playing, mainController.PlayState, "The sound play status was stopped but the sound is supposed to be looped.");
         mainController.Stop();
     }
     // should hear looped sound
     else if (loopCount == 450)
     {
         mainController.Play();
     }
     else if (loopCount == 475)
     {
         // check that IsLooped throws InvalidOperationException when modified while playing.
         Assert.Throws<InvalidOperationException>(() => mainController.IsLooped = true, "setting isLooped variable during playing sound did not throw InvalidOperationException");
         game.Exit();
     }
 }
开发者ID:cg123,项目名称:xenko,代码行数:56,代码来源:TestController.cs

示例14: TestVolumeLoopImpl

 private void TestVolumeLoopImpl(Game game, int loopCount, int loopCountSum)
 {
     if (loopCount == 0)
     {
         // check that setting the volume before play works.
         mainController.Volume = 0.1f;
         mainController.Play();
     }
     // should hear low volume
     else if(loopCount == 60)
     {
        mainController.Volume = 1f;
        mainController.Play();
     }
     // should hear normal volume
     else if (loopCount == 120)
     {
         // check that setting the volume without listener works too
         game.Audio.RemoveListener(listComps[0]);
         game.Audio.RemoveListener(listComps[1]);
         mainController.Volume = 0.1f;
         game.Audio.AddListener(listComps[0]);
         game.Audio.AddListener(listComps[1]);
         mainController.Play();
     }
     // should hear low volume
     else if (loopCount == 180)
     {
         mainController.Volume = 1f;
         mainController.Play();
     }
     // should hear normal volume
     else if (loopCount == 240)
     {
         mainController.Volume = 0f;
         mainController.IsLooped = true;
         mainController.Play();
     }
     else if(loopCount > 240)
     {
         // check that sound goes smoothly from nothing to full intensity
         mainController.Volume = Math.Abs((loopCount - 440) / 200f);
     }
     // the sound should go up and down
     if (loopCount == 640)
     {
         game.Exit();
     }
 }
开发者ID:cg123,项目名称:xenko,代码行数:49,代码来源:TestController.cs

示例15: Quit

        private static void Quit(Game game)
        {
            game.Exit();

#if SILICONSTUDIO_PLATFORM_ANDROID
            global::Android.OS.Process.KillProcess(global::Android.OS.Process.MyPid());
#endif
        }
开发者ID:hsabaleuski,项目名称:paradox,代码行数:8,代码来源:GameTestingSystem.cs


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