Class CustomPhysicsSystemGroup
This abstract class can be used to create a system group for a custom physics world. To create a custom physics group, derive from this class and implement empty constructor which calls one of two constructors of this class, and potentially implement some of the other virtual functions.
Inheritance
Inherited Members
Namespace: Unity.Physics.Systems
Assembly: Unity.Physics.dll
Syntax
public abstract class CustomPhysicsSystemGroup : CustomPhysicsSystemGroupBase
Remarks
If class that derives CustomPhysicsSystemGroup doesn't need the Simulation to be recreated on each OnStartRunning then it should override OnStartRunning and guard instantiation of new Simulation so it happens only once. It also has to override OnStopRunning and move disposing of simulation to it's own Dispose method.
Constructors
CustomPhysicsSystemGroup(uint, bool)
Constructor. Your subclass needs to implement an empty constructor which is calling this one to properly set up the world index.
Declaration
protected CustomPhysicsSystemGroup(uint worldIndex, bool shareStaticColliders)
Parameters
Type | Name | Description |
---|---|---|
uint | worldIndex | A world index for a physics world. |
bool | shareStaticColliders | Should static colliders be shared between main world and this one. |
Methods
PostGroupUpdateCallback()
Called after the systems in this group are updated. It is useful in cases of needing to restore system state (such as NativeArrays, NativeLists etc), after it is ran in a custom group. If overriding this method, make sure to call base.PostGroupUpdateCallback().
Declaration
protected override void PostGroupUpdateCallback()
Overrides
PreGroupUpdateCallback()
Called before the systems in this group are updated. It is useful in cases of needing to store system state (such as NativeArrays, NativeLists etc), before it is ran in a custom group. If overriding this method, make sure to call base.PreGroupUpdateCallback().
Declaration
protected override void PreGroupUpdateCallback()