Beispiel #1
0
        private void RemoveConstraintFromPoint(Entity point)
        {
            var value = constrainedPoints[point].NumberConstraints - 1;

            if (value == 0)
            {
                EntityManager.RemoveComponent <DistanceConstrainedPoint>(point);
            }
            else
            {
                constrainedPoints[point] = new DistanceConstrainedPoint()
                {
                    NumberConstraints = value
                }
            };
        }
Beispiel #2
0
 private void AddConstraintToPoint(Entity point)
 {
     if (EntityManager.HasComponent <DistanceConstrainedPoint>(point))
     {
         constrainedPoints[point] = new DistanceConstrainedPoint()
         {
             NumberConstraints = constrainedPoints[point].NumberConstraints + 1
         }
     }
     ;
     else
     {
         EntityManager.AddComponentData(point, new DistanceConstrainedPoint()
         {
             NumberConstraints = 1
         });
     }
 }