Class EndJointConversionSystem
A system that is updated after all built-in conversion systems that produce PhysicsJoint.
Inheritance
Inherited Members
Namespace: Unity.Physics.Authoring
Syntax
public class EndJointConversionSystem : GameObjectConversionSystem
Methods
CreateJointEntities(Component, PhysicsConstrainedBodyPair, NativeArray<PhysicsJoint>, NativeList<Entity>)
Create several new entities for a joint associated with the specified authoring component.
Other systems can later find these joints by using GetJointEntities(Component, NativeList<Entity>).
Use this method instead of CreateJointEntity(Component, PhysicsConstrainedBodyPair, PhysicsJoint) when the behavior specified by the authoring component requires multiple PhysicsJoint components to describe.
The new entities will have all required component types,
Declaration
public void CreateJointEntities(Component authoringComponent, PhysicsConstrainedBodyPair constrainedBodyPair, NativeArray<PhysicsJoint> joints, NativeList<Entity> newJointEntities = null)
Parameters
Type | Name | Description |
---|---|---|
Component | authoringComponent | An authoring component being converted. |
PhysicsConstrainedBodyPair | constrainedBodyPair | A component describing the bodies constrained by the joints. |
NativeArray<PhysicsJoint> | joints | The set of reference frames and corresponding constraints to apply to the bodies. |
NativeList<Entity> | newJointEntities | An optional list to populate with all of the new entities. |
CreateJointEntity(Component, PhysicsConstrainedBodyPair, PhysicsJoint)
Create a new entity for a joint associated with the specified authoring component. Other systems can later find this joint by using GetJointEntities(Component, NativeList<Entity>). Use this method when the behavior specified by the authoring component can be described with a single PhysicsJoint (see also CreateJointEntities(Component, PhysicsConstrainedBodyPair, NativeArray<PhysicsJoint>, NativeList<Entity>)). The new entity will have all required component types as well as a readable name in the Entity Debugger.
Declaration
public Entity CreateJointEntity(Component authoringComponent, PhysicsConstrainedBodyPair constrainedBodyPair, PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
Component | authoringComponent | An authoring component being converted. |
PhysicsConstrainedBodyPair | constrainedBodyPair | A component describing the bodies constrained by the joint. |
PhysicsJoint | joint | The reference frames and set of constraints to apply to the bodies. |
Returns
Type | Description |
---|---|
Entity | A new entity with all required component types. |
GetJointEntities(Component, NativeList<Entity>)
Get all joint entities that have been produced by the specified authoring component. In order to work, these entities must have been produced by either CreateJointEntity(Component, PhysicsConstrainedBodyPair, PhysicsJoint) or CreateJointEntities(Component, PhysicsConstrainedBodyPair, NativeArray<PhysicsJoint>, NativeList<Entity>).
Declaration
public void GetJointEntities(Component authoringComponent, NativeList<Entity> jointEntities)
Parameters
Type | Name | Description |
---|---|---|
Component | authoringComponent | The authoring component that produced one or more joint entities. |
NativeList<Entity> | jointEntities | A list to populate with all of the joint entities. |
OnDestroy()
Declaration
protected override void OnDestroy()
Overrides
OnUpdate()
Declaration
protected override void OnUpdate()