public Physics2dComponent CreateComponent(Entity entity, BodyDefinition definition, bool remoteSync = true)
{
var body = CreateBody(definition);
var component = new Physics2dComponent();
component.Body = body;
body.UserData = entity;
entity.AddComponent(component);
if (remoteSync)
{
ObjectMapper.Create(
(uint)entity.UniqueId, typeof(NetPhysicsObject));
}
return component;
}