Click or drag to resize

Archon.SwissArmyLib.Gravity Namespace

Contains classes related to the gravitational system.
Public classGravitationalEntity
Makes this GameObject's Rigidbody part of the gravitational system. For 2D physics see GravitationalEntity2D.
Public classGravitationalEntity2D
Makes this GameObject's Rigidbody2D part of the gravitational system. For 3D physics see GravitationalEntity.
Public classGravitationalSystem
A gravitational system to allow for a more flexible gravity instead of just a constant directional gravity. Useful for planets, black holes, magnets etc. Rigidbodies that should be affected should have the GravitationalEntity component (or GravitationalEntity2D if using 2d physics). Add gravitational forces by implementing the IGravitationalAffecter interface and registering it in the system. See SphericalGravitationalPoint for a simple example implementation.
You might want to set Unity's gravity to (0,0,0).
Public classSphericalGravitationalPoint
A sphere-shaped gravitational point.
The force is currently constant and not dependent on how close the entities are.
Public interfaceIGravitationalAffecter
Represents a gravitational pull on entities.