mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +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 skeletonData: SkeletonData;
|
||||
if (this.config.jsonUrl) {
|
||||
let jsonText = this.assetManager.get(this.config.jsonUrl);
|
||||
let jsonUrl = 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));
|
||||
try {
|
||||
skeletonData = json.readSkeletonData(jsonText);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user