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); }
public List <HitBox> GetHitbox(HitBox.Type type) { return(hitboxes.FindAll((HitBox h) => h._type == type)); }