Skip to content

Commit dbe7d2f

Browse files
committed
Added more information to the README.md
1 parent 93aa0a2 commit dbe7d2f

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

LowLevel/Packages/com.unity.2d.physics.lowlevelextras/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,28 @@
22
Physics2D LowLevel Extras is a package that contains extra scripts for use with the LowLevel 2D Physics features in Unity.
33

44
This package is unsupported and is provided as example only to support the low-level project examples.
5+
6+
---
7+
8+
This package contains simple Unity components that encapsule low-level physics objects making it easy to get up and running quickly and easily.
9+
10+
These components are all prefixed with "Scene" with the following being provided:
11+
- **SceneWorld** - Creates a [PhysicsWorld](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsWorld.html)
12+
- **SceneBody** - Creates a [PhysicsBody](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsBody.html)
13+
- Shapes:
14+
- **SceneShape** - Creates a single [PhysicsShape](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsShape.html) with either [CircleGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.CircleGeometry.html), [CapsuleGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.CapsuleGeometry.html), [PolygonGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PolygonGeometry.html), [SegmentGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.SegmentGeometry.html) or [ChainSegmentGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.ChainSegmentGeometry.html).
15+
- **SceneOutlineShape** - Creates multiple [PhysicsShape](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsShape.html) with [PolygonGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PolygonGeometry.html) in the form of an arbitrary concave/convex outline.
16+
- **SceneSpriteShape** - Creates multiple [PhysicsShape](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsShape.html) with [PolygonGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PolygonGeometry.html) from the physics data contained in a [Sprite]https://docs.unity3d.com/6000.3/Documentation/ScriptReference/Sprite.html.
17+
- **SceneChain** - Creates a single continuous set of [PhysicsShape](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsShape.html) with [ChainSegmentGeometry](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.ChainSegmentGeometry.html) with one-way feature.
18+
- Joints:
19+
- **SceneDistanceJoint** - Creates a [PhysicsDistanceJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsDistanceJoint.html).
20+
- **SceneFixedJoint** - Creates a [PhysicsFixedJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsDFixedJoint.html).
21+
- **SceneHingeJoint** - Creates a [PhysicsHingeJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsHingeJoint.html).
22+
- **SceneIgnoreJoint** - Creates a [PhysicsIgnoreJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsIgnoreJoint.html).
23+
- **SceneRelativeJoint** - Creates a [PhysicsRelativeJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsRelativeJoint.html).
24+
- **SceneSliderJoint** - Creates a [PhysicsSliderJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsSliderJoint.html).
25+
- **SceneWheelJoint** - Creates a [PhysicsWheelJoint](https://docs.unity3d.com/6000.3/Documentation/ScriptReference/LowLevelPhysics2D.PhysicsWheelJoint.html).
26+
27+
When a *SceneShape* or *SceneChain* is added to the scene, in-scene editors are available to edit the shape geometry directly in the scene.
28+
29+
---

LowLevel/README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
# Physics 2D LowLevel Examples
2+
23
This repository contains test projects, examples and a test package for use with the LowLevel 2D Physics features in Unity.
34

45
To use the low-level features, you will require Unity 6000.0.3a5 or beyond.
56

6-
7-
# Physics 2D LowLevel Sandbox
8-
9-
This repository contains examples that can be built to a player.
10-
To run, load the main "Sandbox" scene and press "Play". Alternately, built to a player and run.
11-
7+
---
128
Acknowledgement and thanks is made to Erin Catto, the creator of Box2D v3, from which significant portions of this "Sandbox" project is based upon.
139

1410
Go try it here!
1511
https://github.com/erincatto/box2d
12+
---
13+
14+
### Physics 2D LowLevel Sandbox
15+
16+
This repository contains examples that can be built to a player. To run, load the main "Sandbox" scene and press "Play". Alternately, build to a player and run.
17+
18+
Each sample can be found in "Assets/Scenes/<Category>/<SampleName>" and all share the same configuration.
19+
20+
In each sample there is at least a single ".cs" file containing all the sample code. There's also a ".unity" scene and finally a ".uxml" for the sample UI.
21+
22+
The structure of the ".cs" script file is consistent for all samples and typically contains the following methods:
23+
24+
- OnEnable - Grabs the Sandbox Manager and Camera Manipulator and initializes any sample fields. Also, other global physics or sandbox state may be overriden here. Here we always call "SetupOptions" and "SetupScene" (see below).
25+
- OnDisable - Typically destroys any temporary storage and restores any global physics or Sandbox state.
26+
- SetupOptions - This is always called from "OnEnable" and always configures the sample UI to dynamically control the sample (sample option in the lower-level UI).
27+
- SetupScene - This is always called from "OnEnable" but is also called from the sample UI when pressing the "ResetScene" button on all samples. Here is where all the sample physics objects are created.
28+
- Update - Some samples use this to perform per-frame updates such as world drawing.
29+
- Misc - Some samples have miscellaneous methods (sometimes used in "SetupScene") to spawn or control the physics objects. Some are hooked into the pre/post simulate to perform an action when the simulation is about to or has run.
1630

31+
The "Scripts" folder are typically utility scripts used by various scenes such as spawning physics objects i.e. ragdolls, softbodies etc.
1732

0 commit comments

Comments
 (0)