Hello,
BaseVertexEffect had a virtual method that gets a list of UIVertex
which i used to add vertices and reorder the existing ones…
Now I get a mesh and tried to add vertices and colors but it just causes the text to disappear
I have also tried adding indices but it doesnt work either…
And I cannot go back to BaseVertexEffect because it is forcing me to use BaseMeshEffect by an error.
Hi,
I had your same issue. To solved it, I just followed the same approach the new Shadow effect does.
#if UNITY_5_2
public partial class MyEffect : BaseMeshEffect
#else
public partial class MyEffect : BaseVertexEffect
#endif
{
#if UNITY_5_2
public override void ModifyMesh (Mesh mesh)
{
if (!this.IsActive())
return;
List<UIVertex> list = new List<UIVertex>();
using (VertexHelper vertexHelper = new VertexHelper(mesh))
{
vertexHelper.GetUIVertexStream(list);
}
ModifyVertices(list); // calls the old ModifyVertices which was used on pre 5.2
using (VertexHelper vertexHelper2 = new VertexHelper())
{
vertexHelper2.AddUIVertexTriangleStream(list);
vertexHelper2.FillMesh(mesh);
}
}
#endif
public void ModifyVertices(List<UIVertex> verts)
{
// you code goes here
}
Notice that my declaration uses BaseMeshEffect when 5.2 and BaseVertexEffect otherwise.
Also notice, that the list vertices now has triangles instead of quads.