Unity ProBuilder SetUVs 不起作用

ProBuilder SetUVs 不起作用

Unity ProBuilder SetUVs 不起作用_第1张图片

需要设置face.manulUV = true

        public static void Set01UV(this ProBuilderMesh mesh)
        {
            foreach (var face in mesh.faces)
            {
                face.manualUV = true;//设置为手动uv
            }
            var vertices = mesh.GetVertices().Select(v => v.position).ToArray();
            var uvs = vertices.GetPolyMesh01UVsXZ(); //自定义uv
            mesh.SetUVs(0,uvs.Select(uv=>new Vector4(uv.x,uv.y,0,0)).ToList());
            mesh.Refresh(mask: RefreshMask.UV);//刷新uv
        }

你可能感兴趣的:(Unity,unity,ProBuilder,UV)