mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Fix all scene share the same spine renderer.
This commit is contained in:
parent
eb6ef7debd
commit
4ada682501
1 changed files with 14 additions and 7 deletions
|
@ -461,11 +461,15 @@ var SpinePlugin = new Class({
|
|||
}
|
||||
};
|
||||
|
||||
var sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);
|
||||
sceneRenderer.batcher.setBlendMode = setBlendMode;
|
||||
sceneRenderer.shapes.setBlendMode = setBlendMode;
|
||||
var sceneRenderer = this.renderer.spineSceneRenderer;
|
||||
if (!sceneRenderer) {
|
||||
sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);
|
||||
sceneRenderer.batcher.setBlendMode = setBlendMode;
|
||||
sceneRenderer.shapes.setBlendMode = setBlendMode;
|
||||
this.renderer.spineSceneRenderer = sceneRenderer;
|
||||
}
|
||||
|
||||
// All share the same instance
|
||||
// All scene share the same instance
|
||||
this.sceneRenderer = sceneRenderer;
|
||||
this.skeletonRenderer = sceneRenderer.skeletonRenderer;
|
||||
this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer;
|
||||
|
@ -1131,11 +1135,14 @@ var SpinePlugin = new Class({
|
|||
|
||||
this.pluginManager = null;
|
||||
|
||||
if (this.sceneRenderer)
|
||||
var sceneRenderer = this.renderer.spineSceneRenderer;
|
||||
|
||||
if (sceneRenderer)
|
||||
{
|
||||
this.sceneRenderer.dispose();
|
||||
this.sceneRenderer = null;
|
||||
sceneRenderer.dispose();
|
||||
}
|
||||
this.renderer.spineSceneRenderer = null;
|
||||
this.sceneRenderer = null;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue