Skip to content

Commit

Permalink
Add error checking for Apply slot color.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikalDev committed Feb 13, 2021
1 parent d72f850 commit 5dc4ca4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/c3runtime/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@
for(slotName in this.slotColors)
{
let slot = skeleton.findSlot(slotName);
if (slot === null)
{
console.warn("[Spine] ApplySlotColors, slot not found: ",slotName,this.uid,this.runtime.GetTickCount());
continue;
}
let color = this.slotColors[slotName];
slot.color.set(
spineBatcher.getRValue(color),
Expand All @@ -259,6 +264,11 @@
for(slotName in this.slotDarkColors)
{
let slot = skeleton.findSlot(slotName);
if (slot === null)
{
console.warn("[Spine] ApplySlotColors dark color, slot not found: ",slotName,this.uid,this.runtime.GetTickCount());
continue;
}
// Set only if dark Color is available, (Tint Black must be applied to the slot in the project.)
if (slot.darkColor)
{
Expand Down

0 comments on commit 5dc4ca4

Please sign in to comment.