public NavShape(Nav2D nav2D, List <IntPoint> points, bool hole, List <PolyNode> children, NavShape parent, NavElement.Type navType) { Points = new Vector2[points.Count]; for (int i = 0; i < Points.Length; ++i) { Points[i] = nav2D.ParseToVector2(points[i]); } Hole = hole; NavType = navType; Parent = parent; if (children == null || children.Count == 0) { Children = null; return; } Children = new List <NavShape>(); foreach (var child in children) { Children.Add(new NavShape(nav2D, child.Contour, child.IsHole, child.Childs, this, navType)); } }
public NavShape(Vector2[] points, NavElement.Type navType) { Points = points; Hole = false; Children = null; Parent = null; NavType = navType; }