[unity] Prevent null reference exception when using Advanced - Fix Draw Order and disabling the renderer and/or GameObject.

This commit is contained in:
Harald Csaszar 2021-04-22 11:45:58 +02:00
parent e425d64d2c
commit 1e888db53a

View File

@ -690,6 +690,9 @@ namespace Spine.Unity {
}
for (int i = 0; i < meshRenderer.sharedMaterials.Length; ++i) {
if (!meshRenderer.sharedMaterials[i])
continue;
if (!hasPerRendererBlock) meshRenderer.GetPropertyBlock(reusedPropertyBlock, i);
// Note: this parameter shall not exist at any shader, then Unity will create separate
// material instances (not in terms of memory cost or leakage).