The Spine Plugin add and make functions didn't clear and rebind the WebGL pipeline. This could cause two different visual issues: The first is that a Phaser Game Object (such as a Sprite) could be seen to change its texture to display the Spine atlas texture instead for a single frame, and then on the next pass revert back to normal again. The second issue is that if the Spine skeleton wasn't added to the display list, but just created (via addToScene: false) then the Sprite would take on the texture frame entirely from that point on. Fix #6362

This commit is contained in:
Richard Davey 2023-02-06 16:44:32 +00:00
parent b2f9c522ff
commit 1fa400b431

View file

@ -319,14 +319,26 @@ var SpinePlugin = new Class({
};
}
var isWebGL = this.isWebGL;
var add = function (x, y, key, animationName, loop)
{
if (isWebGL)
{
this.scene.sys.renderer.pipelines.clear();
}
var spinePlugin = this.scene.sys[pluginKey];
var spineGO = new SpineGameObject(this.scene, spinePlugin, x, y, key, animationName, loop);
this.displayList.add(spineGO);
this.updateList.add(spineGO);
if (isWebGL)
{
this.scene.sys.renderer.pipelines.rebind();
}
return spineGO;
};
@ -334,6 +346,11 @@ var SpinePlugin = new Class({
{
if (config === undefined) { config = {}; }
if (isWebGL)
{
this.scene.sys.renderer.pipelines.clear();
}
var key = GetValue(config, 'key', null);
var animationName = GetValue(config, 'animationName', null);
var loop = GetValue(config, 'loop', false);
@ -364,6 +381,11 @@ var SpinePlugin = new Class({
spineGO.setAttachment(slotName, attachmentName);
}
if (isWebGL)
{
this.scene.sys.renderer.pipelines.rebind();
}
return spineGO.refresh();
};