galacean / engine-spine

MIT License
9 stars 8 forks source link

Fix skin set problem #100

Closed johanzhu closed 4 months ago

johanzhu commented 4 months ago

The order of calling the resource setter and skinName setter of SpineRenderer is irrelevant. To prevent the skin from not being set correctly under such circumstances, if the skinName setter is called first, the _skinName variable will be stored. Later, when the resource setter is invoked, it tries to set the skin internally via the skinName setter. However, by this time, _skinName has already been stored and is the same as the argument passed to the setter, which causes the skin setting to fail. Therefore, the PR has improved this by setting the skin directly rather than through the skinName setter.