public virtual void OnBeginContact(Actor otherActor, Box2DX.Collision.Shape shape, Box2DX.Collision.Shape otherShape) { bool canAdd = true; foreach (var actor in overlappingActors) { if (actor == otherActor) { canAdd = false; break; } } if (canAdd) { overlappingActors.Add(otherActor); } owner.OnBeginContact(otherActor, shape, otherShape); }
public virtual void OnEndContact(Actor otherActor, Box2DX.Collision.Shape shape, Box2DX.Collision.Shape otherShape) { overlappingActors.Remove(otherActor); owner.OnEndContact(otherActor, shape, otherShape); }