[unity] Fix PMA for SkeletonRenderSeparator.

This commit is contained in:
pharan 2016-09-08 20:43:03 +08:00
parent 1fafe6bd40
commit fbd8e32c06
2 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,7 @@ namespace Spine.Unity.MeshGeneration {
MeshAndMaterials GenerateMesh (ExposedList<SubmeshInstruction> instructions, int startSubmesh, int endSubmesh);
float ZSpacing { get; set; }
bool PremultiplyVertexColors { get; set; }
bool AddNormals { get; set; }
bool AddTangents { get; set; }
}

View File

@ -137,6 +137,7 @@ namespace Spine.Unity.Modules {
var currentRenderer = partsRenderers[rendererIndex];
bool addNormals = skeletonRenderer.calculateNormals;
bool addTangents = skeletonRenderer.calculateTangents;
bool pmaVertexColors = skeletonRenderer.pmaVertexColors;
for (int si = 0, start = 0; si <= lastSubmeshInstruction; si++) {
if (submeshInstructionsItems[si].forceSeparate || si == lastSubmeshInstruction) {
@ -144,6 +145,7 @@ namespace Spine.Unity.Modules {
var meshGenerator = currentRenderer.MeshGenerator;
meshGenerator.AddNormals = addNormals;
meshGenerator.AddTangents = addTangents;
meshGenerator.PremultiplyVertexColors = pmaVertexColors;
if (copyPropertyBlock)
currentRenderer.SetPropertyBlock(copiedBlock);