示例#1
0
        public Vector2 GetMiddleOf(HitBox.Type type)
        {
            List <HitBox> l   = GetHitbox(type);
            Vector2       pos = new Vector2();

            foreach (HitBox h in l)
            {
                pos += h._position + h._size / 2f;
            }
            pos /= (float)l.Count;
            return(pos);
        }
示例#2
0
 public List <HitBox> GetHitbox(HitBox.Type type)
 {
     return(hitboxes.FindAll((HitBox h) => h._type == type));
 }