예제 #1
0
        public PlayerStateData(Physics2dComponent p2Comp)
        {
            if (p2Comp != null && p2Comp.Body != null)
                Position = p2Comp.Body.Position;

            SimTick = NetTime.SimTick;
        }
예제 #2
0
파일: Midgard.cs 프로젝트: enBask/Asgard
        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;
        }
예제 #3
0
파일: Midgard.cs 프로젝트: enBask/Asgard
 public void DeleteBody(Physics2dComponent comp)
 {
     if (comp != null && comp.Body != null)
     {
         _queueDeleteList.Add(comp.Body);
         comp.Body = null;
     }
 }