This is an imported cube Blender, the script told me exactly the same values as in Blender.
Here is the script
#pragma strict
public var theCube : Transform;
private var theUVs : String = "";
function Start ()
{
if (theCube == null)
theCube = this.transform;
var theMesh : Mesh = theCube.GetComponent(MeshFilter).mesh as Mesh;
theUVs = theUVs + "(" + theMesh.uv.length.ToString() + ") :";
for (var i:int = 0; i < theMesh.vertices.length; i ++) {
theUVs = theUVs + " " + i + "=" + theMesh.uv[i].ToString();
}
}
function OnGUI ()
{
GUI.Label( Rect( 10, Screen.height * 0.25, Screen.width - 20, Screen.height * 0.25), "UVs " + theUVs );
}
Having said that, with the following script, I can move my UVs ... but when I use "mouse select uv'' to the new coordinates, it does not work, I always start UV coordinates, have you any idea? Merci
#pragma strict
public var theCube : Transform;
function MoveUV_1 ( UVf : float)
{
if (theCube == null)
theCube = this.transform;
var theMesh : Mesh = theCube.GetComponent(MeshFilter).mesh as Mesh;
var UVs : Vector2[] = new Vector2[theMesh.uv.Length];
UVs = theMesh.uv;
for (var i:int = 0; i < theMesh.vertices.length; i ++) {
if (UVs[i].x == 0.1){
UVs[i] = Vector2 (0.1, UVf);
}
theMesh.uv = UVs;
}
}