本文整理汇总了C#中SceneManager.NextScene方法的典型用法代码示例。如果您正苦于以下问题:C# SceneManager.NextScene方法的具体用法?C# SceneManager.NextScene怎么用?C# SceneManager.NextScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneManager
的用法示例。
在下文中一共展示了SceneManager.NextScene方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: firstSceneEndingTriggersLoopStart
public void firstSceneEndingTriggersLoopStart()
{
var firstScene = factory.CreateMock<Scene>(MockStyle.Stub);
var lastScene = factory.CreateMock<Scene>(MockStyle.Stub);
var messagePromptCoordinator = new MessagePromptCoordinator(null, null);
firstScene.Stub.Out.Method(_ => _.TimeLength()).WillReturn(0.0f);
// emulate behavior of sceneFactory and return mock Scenes
sceneFactory.Expects.AtLeastOne.Method(_ => _.PreloadAssets());
sceneFactory.Expects.AtLeastOne.Method(_ => _.GetFirstScene()).WillReturn(firstScene.MockObject);
sceneFactory.Expects.AtLeastOne.MethodWith(_ => _.isLastScene(firstScene.MockObject)).WillReturn(false);
loopTracker.Expects.One.Method(_ => _.startPlaying());
loopTracker.Expects.One.Method(_ => _.Rewind(0f)).WithAnyArguments();
loopTracker.Expects.One.Method(_ => _.NextLoop(0f)).WithAnyArguments();
loopTracker.Expects.One.Method(_ => _.Stop());
sceneFactory.Expects.One.MethodWith(_ => _.GetSceneAfter(firstScene.MockObject)).WillReturn(lastScene.MockObject);
sceneFactory.Expects.AtLeastOne.MethodWith(_ => _.isLastScene(lastScene.MockObject)).WillReturn(true);
sceneFactory.Expects.AtLeastOne.Method(_ => _.Reset());
var sceneManager = new SceneManager(sceneFactory.MockObject, loopTracker.MockObject, messagePromptCoordinator);
sceneManager.NextScene();
sceneManager.NextScene();
}