Exemple #1
0
        /// <summary>
        /// Create uv of hose mesh.
        /// </summary>
        /// <param name="isSeal">Is seal at both ends of hose?</param>
        /// <returns>UV array.</returns>
        protected Vector2[] CreateUV(bool isSeal = false)
        {
            var uv = MeshUtility.CreateUVBasePrism(polygon, segmentCount);

            if (isSeal)
            {
                for (int i = 0; i < 2; i++)
                {
                    uv.Add(Vector2.one * 0.5f);
                    uv.AddRange(MeshUtility.CreateUVBasePolygon(polygon));
                }
            }
            return(uv.ToArray());
        }