/// <summary> /// Creates the curve. /// </summary> /// <param name="positionList">Position list.</param> /// <param name="action">メッシュ生成に必要な情報を受け取るコールバック.</param> public static void CreateArea(List <Vector3> positionList, Action <CreateRoadMeshScripts.MeshSet> action) { var positionSetList = new PositionSetList(); for (int i = 0; i < positionList.Count; i++) { int prevIndex = i - 1; int nextIndex = i + 1; if (i == 0) { prevIndex = positionList.Count - 1; } if (i == positionList.Count - 1) { nextIndex = 0; } positionSetList.Add(new PositionSet { position = positionList[i], Index = i, PrevIndex = prevIndex, NextIndex = nextIndex, }); } SeparateAreaSet(positionSetList, action); }