public PlayerStateData(Physics2dComponent p2Comp) { if (p2Comp != null && p2Comp.Body != null) Position = p2Comp.Body.Position; SimTick = NetTime.SimTick; }
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; }
public void DeleteBody(Physics2dComponent comp) { if (comp != null && comp.Body != null) { _queueDeleteList.Add(comp.Body); comp.Body = null; } }