Skip to content

Commit 449ca11

Browse files
Linking audio and json files when loading audioSprite and setting their linkType to audioSprite
1 parent 8dc987b commit 449ca11

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

v3/src/scene/plugins/Loader.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,19 @@ var Loader = new Class({
120120

121121
audioSprite: function (key, urls, json, config, audioXhrSettings, jsonXhrSettings)
122122
{
123-
this.audio(key, urls, config, audioXhrSettings);
124-
this.json(key, json, jsonXhrSettings);
123+
var audioFile = AudioFile.create(this, key, urls, config, audioXhrSettings);
124+
var jsonFile = new JSONFile(key, json, this.path, jsonXhrSettings);
125+
126+
// Link them together
127+
audioFile.linkFile = jsonFile;
128+
jsonFile.linkFile = audioFile;
129+
130+
// Set the type
131+
audioFile.linkType = 'audioSprite';
132+
jsonFile.linkType = 'audioSprite';
133+
134+
this.addFile(audioFile);
135+
this.addFile(jsonFile);
125136

126137
return this;
127138
},

0 commit comments

Comments
 (0)