mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 18:56:54 +08:00
[ts] If the spine-player jsonUrl has an anchor, use it to find the skeleton in the JSON.
This enables multiple skeletons in the same JSON file.
This commit is contained in:
parent
d3f9885fbc
commit
87886adcfe
@ -864,8 +864,11 @@ module spine {
|
|||||||
|
|
||||||
let atlas = this.assetManager.get(this.config.atlasUrl);
|
let atlas = this.assetManager.get(this.config.atlasUrl);
|
||||||
let skeletonData: SkeletonData;
|
let skeletonData: SkeletonData;
|
||||||
if (this.config.jsonUrl) {
|
let jsonUrl = this.config.jsonUrl;
|
||||||
let jsonText = this.assetManager.get(this.config.jsonUrl);
|
if (jsonUrl) {
|
||||||
|
let jsonText = this.assetManager.get(jsonUrl);
|
||||||
|
let hash = jsonUrl.indexOf("#");
|
||||||
|
if (hash != -1) jsonText = JSON.parse(jsonText)[jsonUrl.substr(hash + 1)];
|
||||||
let json = new SkeletonJson(new AtlasAttachmentLoader(atlas));
|
let json = new SkeletonJson(new AtlasAttachmentLoader(atlas));
|
||||||
try {
|
try {
|
||||||
skeletonData = json.readSkeletonData(jsonText);
|
skeletonData = json.readSkeletonData(jsonText);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user