When trying to setup a simple rectangle using SetVertices(), I only get a Triangle. The bottom right of the rectangle is missing. When doing the same thing in Unity 5.1, it works as expected.
UIVertex vertex = new UIVertex ();
vertex.color = Color.white;
vertex.uv0 = new Vector2 (0, 0);
// Bottom Left
vertex.position = new Vector3 (0, 0, 0);
vertex.uv0 = new Vector2 (0, 0);
//vertex.color = Color.white;
m_uiVertices [0] = vertex;
// Top Left
vertex.position = new Vector3 (0, 5, 0);
vertex.uv0 = new Vector2 (0, 1);
//vertex.color = Color.yellow;
m_uiVertices [1] = vertex;
// Top Right
vertex.position = new Vector3 (5, 5, 0);
vertex.uv0 = new Vector2 (1, 1);
//vertex.color = Color.red;
m_uiVertices [2] = vertex;
// Bottom Right
vertex.position = new Vector3 (5, 0, 0);
vertex.uv0 = new Vector2 (1, 0);
//vertex.color = Color.blue;
m_uiVertices [3] = vertex;
UI vertex list in 5.2 seems to be triangle lists, not quad lists as it was before.
So, maybe you will have to duplicate the vertices and send the 6 vertices that make the quad instead of just the 4 that you previously sent.
Haven’t tried sending the vertices directly to the renderer, but at least for my UI effects I had to place a condition to deal with triangle vs quad depending on the unity version.
I hope not given .SetVertices() was added back in Beta 4 to provide backwards compatibility. Requiring a different setup from previous versions of Unity 5 would defeat that purpose.
btw- we’re also using TextMesh Pro in our project, waiting til I hear this issue is solved before I upgrade to the latest beta. Thanks for being on top of it Stephan/Tim!
Is all this SetVertices and similar stuff only dealing with the UI or does all of this change with regular mesh objects too? I’m doing procedural generation on meshes, but not UI (not using beta right now). Should I be concerned?
Thanks. Are there any docs or anything on this yet so I can see what I’ll have to contend with if I move up to the beta? In this forum all I see are posts about the UI meshes.