mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[ts] Don't use the anchor part of a spine-player jsonUrl in the asset name.
This commit is contained in:
parent
6d7f773bf1
commit
cf35d1e982
@ -438,8 +438,13 @@ module spine {
|
||||
this.assetManager.setRawDataURI(path, data);
|
||||
}
|
||||
}
|
||||
if (config.jsonUrl) this.assetManager.loadText(config.jsonUrl);
|
||||
else this.assetManager.loadBinary(config.skelUrl);
|
||||
let jsonUrl = config.jsonUrl;
|
||||
if (jsonUrl) {
|
||||
let hash = jsonUrl.indexOf("#");
|
||||
if (hash != -1) jsonUrl = jsonUrl.substr(0, hash);
|
||||
this.assetManager.loadText(jsonUrl);
|
||||
} else
|
||||
this.assetManager.loadBinary(config.skelUrl);
|
||||
this.assetManager.loadTextureAtlas(config.atlasUrl);
|
||||
if (config.backgroundImage && config.backgroundImage.url)
|
||||
this.assetManager.loadTexture(config.backgroundImage.url);
|
||||
@ -866,9 +871,14 @@ module spine {
|
||||
let skeletonData: SkeletonData;
|
||||
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 field = null;
|
||||
if (hash != -1) {
|
||||
field = jsonUrl.substr(hash + 1);
|
||||
jsonUrl = jsonUrl.substr(0, hash);
|
||||
}
|
||||
let jsonText = this.assetManager.get(jsonUrl);
|
||||
if (field) jsonText = JSON.parse(jsonText)[field];
|
||||
let json = new SkeletonJson(new AtlasAttachmentLoader(atlas));
|
||||
try {
|
||||
skeletonData = json.readSkeletonData(jsonText);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user