mirror of
https://github.com/photonstorm/phaser
synced 2024-11-21 20:23:19 +00:00
Added optional child argument
This commit is contained in:
parent
f6124e253b
commit
caa55e7ab3
2 changed files with 18 additions and 4 deletions
|
@ -47,7 +47,7 @@ var SpineCanvasPlugin = new Class({
|
|||
return runtime;
|
||||
},
|
||||
|
||||
createSkeleton: function (key)
|
||||
createSkeleton: function (key, child)
|
||||
{
|
||||
var atlasData = this.cache.get(key);
|
||||
|
||||
|
@ -68,7 +68,14 @@ var SpineCanvasPlugin = new Class({
|
|||
|
||||
var skeletonJson = new SpineCanvas.SkeletonJson(atlasLoader);
|
||||
|
||||
var skeletonData = skeletonJson.readSkeletonData(this.json.get(key));
|
||||
var data = this.json.get(key);
|
||||
|
||||
if (child)
|
||||
{
|
||||
data = data[child];
|
||||
}
|
||||
|
||||
var skeletonData = skeletonJson.readSkeletonData(data);
|
||||
|
||||
var skeleton = new SpineCanvas.Skeleton(skeletonData);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ var SpineWebGLPlugin = new Class({
|
|||
return runtime;
|
||||
},
|
||||
|
||||
createSkeleton: function (key)
|
||||
createSkeleton: function (key, child)
|
||||
{
|
||||
var atlasData = this.cache.get(key);
|
||||
|
||||
|
@ -99,7 +99,14 @@ var SpineWebGLPlugin = new Class({
|
|||
|
||||
var skeletonJson = new SpineWebGL.SkeletonJson(atlasLoader);
|
||||
|
||||
var skeletonData = skeletonJson.readSkeletonData(this.json.get(key));
|
||||
var data = this.json.get(key);
|
||||
|
||||
if (child)
|
||||
{
|
||||
data = data[child];
|
||||
}
|
||||
|
||||
var skeletonData = skeletonJson.readSkeletonData(data);
|
||||
|
||||
var skeleton = new SpineWebGL.Skeleton(skeletonData);
|
||||
|
||||
|
|
Loading…
Reference in a new issue