private static CommandFrame Client_Simulate(ClientSimulator simulator, ExampleScene scene, int time, int?expectedCommandSeq = null) { logger.Warn("Begin client simulation: {0}ms", time); simulator.Simulate(); Assert.AreEqual(time + scene.Desc.SimulationDeltaTime, simulator.Time); var frame = simulator.CommandFrame; if (expectedCommandSeq == null) { Assert.IsNull(frame); } else { Assert.AreEqual(1, frame.Commands.Count); Assert.AreEqual(expectedCommandSeq.Value, frame.Commands[0].Sequence); } var ball = (RigidBodySnapshot)scene.Ball.Snapshot; logger.Debug("Ball position: {1}f, {2}f, {3}f", time, ball.Position.X, ball.Position.Y, ball.Position.Z); var cube = (RigidBodySnapshot)scene.Cube.Snapshot; logger.Debug("Cube position: {1}f, {2}f, {3}f", time, cube.Position.X, cube.Position.Y, cube.Position.Z); logger.Warn("End client simulation: {0}ms", time); return(frame); }
public void LoadExampleScene(UILabel exampleScene) { ExampleScene parsedExampleScene = (ExampleScene)Enum.Parse(typeof(ExampleScene), exampleScene.text.Replace(" ", string.Empty)); switch (parsedExampleScene) { case ExampleScene.ScrollingCardsExample: Application.LoadLevel((int)ExampleScene.ScrollingCardsExample); break; case ExampleScene.StackedCardsExample: Application.LoadLevel((int)ExampleScene.StackedCardsExample); break; default: break; } }
override protected void Initialize() { base.Initialize(); // Toggles ImGui Inspector DebugToggle = new VirtualButton().AddKeyboardKey(Keys.F1); // Adding the ImGui manager with a minimal approach. var mgr = new ImGuiManager(); mgr.ShowSeperateGameWindow = false; mgr.ShowCoreWindow = false; RegisterGlobalManager(mgr); mgr.SetEnabled(false); // Finally move into the example scene. Change this to wherever you wanna go! Scene = new ExampleScene(); }
private static DeltaSyncFrame Server_Simulate(ServerSimulator simulator, ExampleScene scene, int time, int expectedEventCount, int?expectedCommandSeq = null) { logger.Error("Begin server simulation: {0}ms", time); simulator.Simulate(); Assert.AreEqual(time + scene.Desc.SimulationDeltaTime, simulator.Time); var frame = simulator.DeltaSyncFrame; Assert.AreEqual(time, frame.Time); Assert.AreEqual(scene.Desc.SimulationDeltaTime, frame.DeltaTime); Assert.AreEqual(expectedEventCount, frame.Events.Count); if (expectedCommandSeq == null) { Assert.AreEqual(0, frame.LastCommandSeqs.Count); } else { var clientId = new ClientId(1); Assert.AreEqual(1, frame.LastCommandSeqs.Count); Assert.AreEqual(expectedCommandSeq.Value, frame.LastCommandSeqs[clientId]); } var ball = (RigidBodySnapshot)scene.Ball.Snapshot; logger.Debug("Ball position: {1}f, {2}f, {3}f", time, ball.Position.X, ball.Position.Y, ball.Position.Z); var cube = (RigidBodySnapshot)scene.Cube.Snapshot; logger.Debug("Cube position: {1}f, {2}f, {3}f", time, cube.Position.X, cube.Position.Y, cube.Position.Z); logger.Error("End server simulation: {0}ms", time); return(frame); }
protected void _AddExampleScene(ExampleScene scene) { m_ExampleScenes.Add(scene); }
protected void AddExampleScene(ExampleScene scene) { _exampleScenes.Add(scene); }
protected override IEnumerator UnloadScene(ExampleScene scene, Action <float, string> progressDelegate) { yield break; }
private static void LoadScene(ExampleScene scene) { SceneManager.LoadScene(sceneNameMapping[scene]); }