forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhysicsSamplesConversionSystem.cs
More file actions
23 lines (21 loc) · 1.33 KB
/
Copy pathPhysicsSamplesConversionSystem.cs
File metadata and controls
23 lines (21 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Unity.Entities;
namespace Unity.Physics.Authoring
{
// IConvertGameObjectToEntity pipeline is called *before* the Physics Body & Shape Conversion Systems
// This means that there would be no Physics components created when Convert was called.
// Instead Convert is called from this specific ConversionSystem for any component that may need
// to read or write the various Physics components at conversion time.
[UpdateAfter(typeof(PhysicsBodyConversionSystem))]
[UpdateAfter(typeof(LegacyRigidbodyConversionSystem))]
[UpdateAfter(typeof(EndJointConversionSystem))]
public class PhysicsSamplesConversionSystem : GameObjectConversionSystem
{
protected override void OnUpdate()
{
Entities.ForEach((SetInertiaInverseBehaviour behaviour) => { behaviour.Convert(GetPrimaryEntity(behaviour), DstEntityManager, this); });
Entities.ForEach((ChangeSphereColliderRadiusAuthoring behaviour) => { behaviour.Convert(GetPrimaryEntity(behaviour), DstEntityManager, this); });
Entities.ForEach((ChangeColliderTypeAuthoring behaviour) => { behaviour.Convert(GetPrimaryEntity(behaviour), DstEntityManager, this); });
Entities.ForEach((ChangeMotionTypeAuthoring behaviour) => { behaviour.Convert(GetPrimaryEntity(behaviour), DstEntityManager, this); });
}
}
}