[unity] Added missing null checks in SkeletonRendererCustomMaterials. Closes #2081.

This commit is contained in:
Harald Csaszar 2022-05-16 19:43:24 +02:00
parent 662c00d547
commit 4f5bc00d66

View File

@ -90,6 +90,7 @@ namespace Spine.Unity {
continue;
Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
if (slotObject != null)
skeletonRenderer.CustomSlotMaterials[slotObject] = slotMaterialOverride.material;
}
}
@ -106,7 +107,8 @@ namespace Spine.Unity {
continue;
Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
if (slotObject == null)
continue;
Material currentMaterial;
if (!skeletonRenderer.CustomSlotMaterials.TryGetValue(slotObject, out currentMaterial))
continue;