Skip to content

Commit 9132e90

Browse files
committed
Sandbox refactoring.
1 parent 360bb4b commit 9132e90

File tree

13 files changed

+105
-40
lines changed

13 files changed

+105
-40
lines changed

LowLevel/Sandbox/Assets/Sandbox.unity

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ MonoBehaviour:
270270
Category: Benchmarks
271271
Description: A collection of objects falling into and constrained by a region.
272272
ScenePath: Assets/Scenes/Benchmark/Barrel/Barrel.unity
273+
- Name: Funnel
274+
Category: Benchmarks
275+
Description: Checking the performance of various collision interactions in a
276+
constrained space.
277+
ScenePath: Assets/Scenes/Benchmark/Funnel/Funnel.unity
273278
- Name: Joint Grid
274279
Category: Benchmarks
275280
Description: A large grid of connected joints.
@@ -303,11 +308,6 @@ MonoBehaviour:
303308
Category: Benchmarks
304309
Description: A simulation of Centripetal forces.
305310
ScenePath: Assets/Scenes/Benchmark/Spinner/Spinner.unity
306-
- Name: Funnel
307-
Category: Benchmarks
308-
Description: Checking the performance of various collision interactions in a
309-
constrained space.
310-
ScenePath: Assets/Scenes/Benchmark/Funnel/Funnel.unity
311311
- Name: Triggers
312312
Category: Benchmarks
313313
Description: Checking the performance of lots of trigger events.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private void Start()
250250
m_SceneManifest = GetComponent<SceneManifest>();
251251
m_MainMenuDocument = GetComponent<UIDocument>();
252252

253-
ColorShapeState = false;
253+
ColorShapeState = true;
254254
m_ShowUI = true;
255255

256256
// Show the Shortcut menu by default.

LowLevel/Sandbox/Assets/Scenes/Batching/Shooter/Shooter.unity

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ MonoBehaviour:
215215
m_TangentSpeed: 0
216216
m_CustomColor:
217217
serializedVersion: 2
218-
rgba: 4282071353
218+
rgba: 4284900966
219219
contactFilter:
220220
m_Categories:
221221
bitMask: 8
@@ -377,7 +377,7 @@ MonoBehaviour:
377377
m_TangentSpeed: 0
378378
m_CustomColor:
379379
serializedVersion: 2
380-
rgba: 4282071353
380+
rgba: 4284900966
381381
contactFilter:
382382
m_Categories:
383383
bitMask: 8
@@ -1032,7 +1032,7 @@ MonoBehaviour:
10321032
m_TangentSpeed: 0
10331033
m_CustomColor:
10341034
serializedVersion: 2
1035-
rgba: 4282071353
1035+
rgba: 4284900966
10361036
contactFilter:
10371037
m_Categories:
10381038
bitMask: 8
@@ -1194,7 +1194,7 @@ MonoBehaviour:
11941194
m_TangentSpeed: 0
11951195
m_CustomColor:
11961196
serializedVersion: 2
1197-
rgba: 4282071353
1197+
rgba: 4284900966
11981198
contactFilter:
11991199
m_Categories:
12001200
bitMask: 8
@@ -1356,7 +1356,7 @@ MonoBehaviour:
13561356
m_TangentSpeed: 0
13571357
m_CustomColor:
13581358
serializedVersion: 2
1359-
rgba: 4282071353
1359+
rgba: 4284900966
13601360
contactFilter:
13611361
m_Categories:
13621362
bitMask: 8
@@ -1766,7 +1766,7 @@ MonoBehaviour:
17661766
m_TangentSpeed: 0
17671767
m_CustomColor:
17681768
serializedVersion: 2
1769-
rgba: 4282071353
1769+
rgba: 4284900966
17701770
contactFilter:
17711771
m_Categories:
17721772
bitMask: 8
@@ -2074,7 +2074,7 @@ MonoBehaviour:
20742074
m_TangentSpeed: 0
20752075
m_CustomColor:
20762076
serializedVersion: 2
2077-
rgba: 4282071353
2077+
rgba: 4284900966
20782078
contactFilter:
20792079
m_Categories:
20802080
bitMask: 8
@@ -2309,7 +2309,7 @@ MonoBehaviour:
23092309
m_TangentSpeed: 0
23102310
m_CustomColor:
23112311
serializedVersion: 2
2312-
rgba: 4282071353
2312+
rgba: 4284900966
23132313
contactFilter:
23142314
m_Categories:
23152315
bitMask: 8
@@ -2755,7 +2755,7 @@ MonoBehaviour:
27552755
m_TangentSpeed: 0
27562756
m_CustomColor:
27572757
serializedVersion: 2
2758-
rgba: 4282071353
2758+
rgba: 4284900966
27592759
contactFilter:
27602760
m_Categories:
27612761
bitMask: 8
@@ -2917,7 +2917,7 @@ MonoBehaviour:
29172917
m_TangentSpeed: 0
29182918
m_CustomColor:
29192919
serializedVersion: 2
2920-
rgba: 4282071353
2920+
rgba: 4284900966
29212921
contactFilter:
29222922
m_Categories:
29232923
bitMask: 8
@@ -3152,7 +3152,7 @@ MonoBehaviour:
31523152
m_TangentSpeed: 0
31533153
m_CustomColor:
31543154
serializedVersion: 2
3155-
rgba: 4282071353
3155+
rgba: 4284900966
31563156
contactFilter:
31573157
m_Categories:
31583158
bitMask: 8
@@ -3314,7 +3314,7 @@ MonoBehaviour:
33143314
m_TangentSpeed: 0
33153315
m_CustomColor:
33163316
serializedVersion: 2
3317-
rgba: 4282071353
3317+
rgba: 4284900966
33183318
contactFilter:
33193319
m_Categories:
33203320
bitMask: 8
@@ -3834,7 +3834,7 @@ MonoBehaviour:
38343834
m_TangentSpeed: 0
38353835
m_CustomColor:
38363836
serializedVersion: 2
3837-
rgba: 4282071353
3837+
rgba: 4284900966
38383838
contactFilter:
38393839
m_Categories:
38403840
bitMask: 8
@@ -4279,7 +4279,7 @@ MonoBehaviour:
42794279
m_TangentSpeed: 0
42804280
m_CustomColor:
42814281
serializedVersion: 2
4282-
rgba: 4282071353
4282+
rgba: 4284900966
42834283
contactFilter:
42844284
m_Categories:
42854285
bitMask: 8
@@ -4514,7 +4514,7 @@ MonoBehaviour:
45144514
m_TangentSpeed: 0
45154515
m_CustomColor:
45164516
serializedVersion: 2
4517-
rgba: 4282071353
4517+
rgba: 4284900966
45184518
contactFilter:
45194519
m_Categories:
45204520
bitMask: 8
@@ -4888,7 +4888,7 @@ MonoBehaviour:
48884888
m_TangentSpeed: 0
48894889
m_CustomColor:
48904890
serializedVersion: 2
4891-
rgba: 4282071353
4891+
rgba: 4284900966
48924892
contactFilter:
48934893
m_Categories:
48944894
bitMask: 8
@@ -5260,7 +5260,7 @@ MonoBehaviour:
52605260
m_TangentSpeed: 0
52615261
m_CustomColor:
52625262
serializedVersion: 2
5263-
rgba: 4282071353
5263+
rgba: 4284900966
52645264
contactFilter:
52655265
m_Categories:
52665266
bitMask: 8
@@ -5422,7 +5422,7 @@ MonoBehaviour:
54225422
m_TangentSpeed: 0
54235423
m_CustomColor:
54245424
serializedVersion: 2
5425-
rgba: 4282071353
5425+
rgba: 4284900966
54265426
contactFilter:
54275427
m_Categories:
54285428
bitMask: 8
@@ -6154,7 +6154,7 @@ MonoBehaviour:
61546154
m_TangentSpeed: 0
61556155
m_CustomColor:
61566156
serializedVersion: 2
6157-
rgba: 4282071353
6157+
rgba: 4284900966
61586158
contactFilter:
61596159
m_Categories:
61606160
bitMask: 8
@@ -6389,7 +6389,7 @@ MonoBehaviour:
63896389
m_TangentSpeed: 0
63906390
m_CustomColor:
63916391
serializedVersion: 2
6392-
rgba: 4282071353
6392+
rgba: 4284900966
63936393
contactFilter:
63946394
m_Categories:
63956395
bitMask: 8
@@ -6551,7 +6551,7 @@ MonoBehaviour:
65516551
m_TangentSpeed: 0
65526552
m_CustomColor:
65536553
serializedVersion: 2
6554-
rgba: 4282071353
6554+
rgba: 4284900966
65556555
contactFilter:
65566556
m_Categories:
65576557
bitMask: 8
@@ -6869,7 +6869,7 @@ MonoBehaviour:
68696869
m_TangentSpeed: 0
68706870
m_CustomColor:
68716871
serializedVersion: 2
6872-
rgba: 4282071353
6872+
rgba: 4284900966
68736873
contactFilter:
68746874
m_Categories:
68756875
bitMask: 8
@@ -7031,7 +7031,7 @@ MonoBehaviour:
70317031
m_TangentSpeed: 0
70327032
m_CustomColor:
70337033
serializedVersion: 2
7034-
rgba: 4282071353
7034+
rgba: 4284900966
70357035
contactFilter:
70367036
m_Categories:
70377037
bitMask: 8
@@ -7650,7 +7650,7 @@ MonoBehaviour:
76507650
m_TangentSpeed: 0
76517651
m_CustomColor:
76527652
serializedVersion: 2
7653-
rgba: 4282071353
7653+
rgba: 4284900966
76547654
contactFilter:
76557655
m_Categories:
76567656
bitMask: 8
@@ -7812,7 +7812,7 @@ MonoBehaviour:
78127812
m_TangentSpeed: 0
78137813
m_CustomColor:
78147814
serializedVersion: 2
7815-
rgba: 4282071353
7815+
rgba: 4284900966
78167816
contactFilter:
78177817
m_Categories:
78187818
bitMask: 8
@@ -8017,7 +8017,7 @@ MonoBehaviour:
80178017
m_TangentSpeed: 0
80188018
m_CustomColor:
80198019
serializedVersion: 2
8020-
rgba: 4282071353
8020+
rgba: 4284900966
80218021
contactFilter:
80228022
m_Categories:
80238023
bitMask: 8
@@ -8216,7 +8216,7 @@ MonoBehaviour:
82168216
m_TangentSpeed: 0
82178217
m_CustomColor:
82188218
serializedVersion: 2
8219-
rgba: 4282071353
8219+
rgba: 4284900966
82208220
contactFilter:
82218221
m_Categories:
82228222
bitMask: 8
@@ -8378,7 +8378,7 @@ MonoBehaviour:
83788378
m_TangentSpeed: 0
83798379
m_CustomColor:
83808380
serializedVersion: 2
8381-
rgba: 4282071353
8381+
rgba: 4284900966
83828382
contactFilter:
83838383
m_Categories:
83848384
bitMask: 8
@@ -8540,7 +8540,7 @@ MonoBehaviour:
85408540
m_TangentSpeed: 0
85418541
m_CustomColor:
85428542
serializedVersion: 2
8543-
rgba: 4282071353
8543+
rgba: 4284900966
85448544
contactFilter:
85458545
m_Categories:
85468546
bitMask: 8
@@ -8702,7 +8702,7 @@ MonoBehaviour:
87028702
m_TangentSpeed: 0
87038703
m_CustomColor:
87048704
serializedVersion: 2
8705-
rgba: 4282071353
8705+
rgba: 4284900966
87068706
contactFilter:
87078707
m_Categories:
87088708
bitMask: 8

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ private void OnEnable()
4949
m_SandboxManager.SceneResetAction = SetupScene;
5050

5151
// Set Overrides.
52+
m_SandboxManager.SetOverrideColorShapeState(false);
5253
m_SandboxManager.SetOverrideDrawOptions(overridenOptions: PhysicsWorld.DrawOptions.AllJoints, fixedOptions: PhysicsWorld.DrawOptions.Off);
5354

5455
m_ObjectType = ObjectType.Ragdoll;
5556

5657
m_OldGravity = PhysicsWorld.defaultWorld.gravity;
5758
m_GravityScale = 2f;
58-
m_ObjectScale = 2f;
59+
m_ObjectScale = 2.5f;
5960
m_SpawnPeriod = 0.75f;
6061
m_FastCollisions = false;
6162

@@ -70,6 +71,7 @@ private void OnDisable()
7071
world.gravity = m_OldGravity;
7172

7273
// Reset overrides.
74+
m_SandboxManager.ResetOverrideColorShapeState();
7375
m_SandboxManager.ResetOverrideDrawOptions();
7476
}
7577

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using UnityEngine;
23
using UnityEngine.LowLevelPhysics2D;
34
using UnityEngine.UIElements;
@@ -27,6 +28,9 @@ private void OnEnable()
2728
// Set up the scene reset action.
2829
m_SandboxManager.SceneResetAction = SetupScene;
2930

31+
// Set Overrides.
32+
m_SandboxManager.SetOverrideColorShapeState(false);
33+
3034
m_GridSize = 100;
3135
m_GridSpacing = 0f;
3236
m_AngularVelocity = 90f;
@@ -36,6 +40,12 @@ private void OnEnable()
3640
SetupScene();
3741
}
3842

43+
private void OnDisable()
44+
{
45+
// Reset overrides.
46+
m_SandboxManager.ResetOverrideColorShapeState();
47+
}
48+
3949
private void SetupOptions()
4050
{
4151
var root = m_UIDocument.rootVisualElement;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using UnityEngine;
23
using UnityEngine.LowLevelPhysics2D;
34
using UnityEngine.UIElements;
@@ -32,6 +33,9 @@ private void OnEnable()
3233
// Set up the scene reset action.
3334
m_SandboxManager.SceneResetAction = SetupScene;
3435

36+
// Set Overrides.
37+
m_SandboxManager.SetOverrideColorShapeState(false);
38+
3539
m_RowCount = 15;
3640
m_ColumnCount = 15;
3741
m_SpawnCount = 10;
@@ -42,6 +46,12 @@ private void OnEnable()
4246
SetupScene();
4347
}
4448

49+
private void OnDisable()
50+
{
51+
// Reset overrides.
52+
m_SandboxManager.ResetOverrideColorShapeState();
53+
}
54+
4555
private void Update()
4656
{
4757
// Finish if the world is paused.

LowLevel/Sandbox/Assets/Scenes/Collision/BounceRagdolls/BounceRagdolls.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private void OnEnable()
3737
m_SandboxManager.SceneResetAction = SetupScene;
3838

3939
// Set Overrides.
40+
m_SandboxManager.SetOverrideColorShapeState(false);
4041
m_SandboxManager.SetOverrideDrawOptions(overridenOptions: PhysicsWorld.DrawOptions.AllJoints, fixedOptions: PhysicsWorld.DrawOptions.Off);
4142

4243
m_OldGravity = PhysicsWorld.defaultWorld.gravity;
@@ -55,6 +56,8 @@ private void OnDisable()
5556

5657
PhysicsEvents.PreSimulate -= OnPreSimulation;
5758

59+
// Reset overrides.
60+
m_SandboxManager.ResetOverrideColorShapeState();
5861
m_SandboxManager.ResetOverrideDrawOptions();
5962
}
6063

0 commit comments

Comments
 (0)