Fix polysec not mapping textures correctly if texture set partly.
This commit is contained in:
@@ -152,6 +152,7 @@ namespace Cryville.Crtr.Components {
|
||||
List<Vector3> verts;
|
||||
List<Vector2> uvs;
|
||||
List<int> trih = null, trib = null, trit = null;
|
||||
static List<int> _emptyTris = new List<int>();
|
||||
|
||||
public override void Seal() {
|
||||
if (vertCount <= 1 || sumLength == 0) return;
|
||||
@@ -192,13 +193,13 @@ namespace Cryville.Crtr.Components {
|
||||
if (body.Frame != null) { m++; GenerateMeshTo(verts, uvs, out trib, body, ref i, ref t, ref l, headLength, sumLength - tailLength, vcpsec, hvc + bvc); }
|
||||
if (tail.Frame != null) { m++; GenerateMeshTo(verts, uvs, out trit, tail, ref i, ref t, ref l, sumLength - tailLength, sumLength, vcpsec, vc); }
|
||||
|
||||
mesh.Mesh.subMeshCount = m;
|
||||
mesh.Mesh.subMeshCount = 3;
|
||||
m = 0;
|
||||
mesh.Mesh.SetVertices(verts);
|
||||
mesh.Mesh.SetUVs(0, uvs);
|
||||
if (head.Frame != null) mesh.Mesh.SetTriangles(trih, m++);
|
||||
if (body.Frame != null) mesh.Mesh.SetTriangles(trib, m++);
|
||||
if (tail.Frame != null) mesh.Mesh.SetTriangles(trit, m++);
|
||||
mesh.Mesh.SetTriangles(head.Frame == null ? _emptyTris : trih, m++);
|
||||
mesh.Mesh.SetTriangles(body.Frame == null ? _emptyTris : trib, m++);
|
||||
mesh.Mesh.SetTriangles(tail.Frame == null ? _emptyTris : trit, m++);
|
||||
mesh.Mesh.RecalculateNormals();
|
||||
|
||||
_vertPool.Return(verts); verts = null;
|
||||
|
Reference in New Issue
Block a user