public void createMesh(XmlNode xmlNode) { XmlNodeList nodeRefs = xmlNode.SelectNodes("nd/@ref"); Vector2[] vertices2D = new Vector2[nodeRefs.Count - 1]; int i = 0; foreach (XmlAttribute refAttribute in nodeRefs) { Pos pos = NodeIndex.nodes [Convert.ToInt64(refAttribute.Value)]; // All "area nodes" are uninteresting nodes NodeIndex.addUninterestingNodeId(pos.Id); if (i == nodeRefs.Count - 1) { break; } Vector3 worldPos = Game.getCameraPosition(pos); vertices2D[i++] = worldPos; } addMeshToGameObject(gameObject, vertices2D); }