Skip to content

Commit 098b432

Browse files
committed
Some scene refactoring.
1 parent b94d364 commit 098b432

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

LowLevel/Sandbox/Assets/Sandbox/Scripts/SandboxManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,10 @@ private void TreeSelectionChanged()
675675
sceneName == m_SceneManifest.LoadedSceneName)
676676
return;
677677

678+
// Unpause the world if paused.
679+
if (WorldPaused)
680+
TogglePauseContinue();
681+
678682
m_CameraManipulator.ResetPanZoom();
679683
m_CameraZoomElement.value = m_CameraManipulator.CameraZoom;
680684

LowLevel/Sandbox/Assets/Scenes/Benchmark/LargeWorld/LargeWorld.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ private void SetupScene()
246246

247247
private void Update()
248248
{
249+
// Finish if the world is paused.
250+
if (m_SandboxManager.WorldPaused)
251+
return;
252+
249253
// Fetch keyboard input.
250254
var currentKeyboard = Keyboard.current;
251255

LowLevel/Sandbox/Assets/Scenes/Shapes/CustomFilter/CustomFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private void SetupScene()
102102
for (var n = 0; n < 15; ++n)
103103
{
104104
var body = m_PhysicsWorld.CreateBody(new PhysicsBodyDefinition { bodyType = RigidbodyType2D.Dynamic, gravityScale = 4f, position = new Vector2(-17.5f + n * 2.5f, 4f) });
105+
bodies.Add(body);
105106

106107
var colorGroup = n % 3;
107108

0 commit comments

Comments
 (0)