예제 #1
0
        public void AddConstraint(DistanceConstraint distanceConstraint)
        {
            AddConstraintToPoint(distanceConstraint.point1);
            AddConstraintToPoint(distanceConstraint.point2);
            var e = EntityManager.CreateEntity();

            EntityManager.AddComponentData(e, distanceConstraint);
        }
예제 #2
0
 public void RemoveConstraint(Entity constraintEntity, DistanceConstraint constraint)
 {
     RemoveConstraintFromPoint(constraint.point1);
     RemoveConstraintFromPoint(constraint.point2);
     EntityManager.DestroyEntity(constraintEntity);
 }