Ejemplo n.º 1
0
        /// <summary>
        /// Creates the curve.
        /// </summary>
        /// <param name="positionList">Position list.</param>
        /// <param name="action">メッシュ生成に必要な情報を受け取るコールバック.</param>
        public static void CreateArea(List <Vector3> positionList, Action <MeshSet> action)
        {
            var positionSetList = new Utility.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 Utility.PositionSet
                {
                    position  = positionList[i],
                    Index     = i,
                    PrevIndex = prevIndex,
                    NextIndex = nextIndex,
                });
            }

            Utility.SeparateAreaSet(positionSetList, action);
        }