@@ -127,8 +127,8 @@ Let's write a script to change the size of the ball when it enters the trigger.
127127
128128 namespace TransformTrigger
129129 {
130- // Adding IContactEventHandler to listen to contact events
131- public class Trigger : SyncScript , IContactEventHandler
130+ // Adding IContactHandler to listen to contact events
131+ public class Trigger : SyncScript , IContactHandler
132132 {
133133 public override void Start ()
134134 {
@@ -143,24 +143,16 @@ Let's write a script to change the size of the ball when it enters the trigger.
143143 // Let objects pass through this trigger, false would make objects bounce off it
144144 public bool NoContactResponse => true ;
145145
146- void IContactEventHandler.OnStartedTouching<TManifold>(CollidableComponent eventSource , CollidableComponent other ,
147- ref TManifold contactManifold ,
148- bool flippedManifold ,
149- int workerIndex ,
150- BepuSimulation bepuSimulation )
146+ void IContactHandler.OnStartedTouching<TManifold>(ContactData<TManifold> contactData)
151147 {
152148 // When something enters inside this object
153- other .Entity .Transform .Scale = new Vector3 (2 . 0 f );
149+ contactData.Other .Entity.Transform.Scale = new Vector3 (2 . 0 f );
154150 }
155151
156- void IContactEventHandler.OnStoppedTouching<TManifold>(CollidableComponent eventSource, CollidableComponent other,
157- ref TManifold contactManifold,
158- bool flippedManifold,
159- int workerIndex,
160- BepuSimulation bepuSimulation)
152+ void IContactHandler.OnStoppedTouching<TManifold>(ContactData<TManifold> contactData)
161153 {
162154 // When something exits this object
163- other .Entity.Transform.Scale = new Vector3(1.0f);
155+ contactData.Other .Entity.Transform.Scale = new Vector3(1.0f);
164156 }
165157 }
166158 }
0 commit comments