File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11var BaseLoader = require ( '../../loader/BaseLoader' ) ;
22var Class = require ( '../../utils/Class' ) ;
33var NumberArray = require ( '../../utils/array/NumberArray' ) ;
4+ var CONST = require ( '../../loader/const' ) ;
45
56var AnimationJSONFile = require ( '../../loader/filetypes/AnimationJSONFile' ) ;
67var AtlasJSONFile = require ( '../../loader/filetypes/AtlasJSONFile' ) ;
@@ -124,7 +125,23 @@ var Loader = new Class({
124125
125126 if ( audioFile )
126127 {
127- var jsonFile = new JSONFile ( key , json , this . path , jsonXhrSettings ) ;
128+ var jsonFile ;
129+
130+ if ( typeof json === 'string' )
131+ {
132+ jsonFile = new JSONFile ( key , json , this . path , jsonXhrSettings ) ;
133+
134+ this . addFile ( jsonFile ) ;
135+ }
136+ else
137+ {
138+ jsonFile = {
139+ type : 'json' ,
140+ key : key ,
141+ data : json ,
142+ state : CONST . FILE_WAITING_LINKFILE
143+ } ;
144+ }
128145
129146 // Link them together
130147 audioFile . linkFile = jsonFile ;
@@ -135,7 +152,6 @@ var Loader = new Class({
135152 jsonFile . linkType = 'audioSprite' ;
136153
137154 this . addFile ( audioFile ) ;
138- this . addFile ( jsonFile ) ;
139155 }
140156
141157 return this ;
You can’t perform that action at this time.
0 commit comments