Пример #1
0
        void Uvs(int t, int _bIndex, int i)
        {
            var vertexDist = SPData.VerticesDistance[_bIndex];
            var x          = Mathf.InverseLerp(0, Segments, i);
            var y          = Mathf.InverseLerp(0, SPData.Length, vertexDist);
            var v          = new Vector2(x, y);

            _Data.Uvs[t] = SplinePlusAPI.Vector2_Rotate_Around_Pivot(v, UVRotation);
        }
Пример #2
0
        public void Uvs()
        {
            uvs = new Vector2[vertices.Count];
            float h = SPData.Length / (Width * 2);

            for (int n = 0, i = 0; i < SPData.Vertices.Count; i++, n = n + 2)
            {
                var x = Mathf.InverseLerp(0, SPData.Length, SPData.VerticesDistance[i]) * h;


                uvs[n]     = new Vector2(x, 0);
                uvs[n + 1] = new Vector2(x, 1);

                uvs[n]     = SplinePlusAPI.Vector2_Rotate_Around_Pivot(uvs[n], UVRotation);
                uvs[n + 1] = SplinePlusAPI.Vector2_Rotate_Around_Pivot(uvs[n + 1], UVRotation);
            }
        }