fix circular dependency (#4616)

This commit is contained in:
Santy-Wang
2019-06-13 17:11:10 +08:00
committed by Weiliang Wang
parent 292584e557
commit e7f1af7d8d
2 changed files with 2 additions and 6 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ export function _doLoadNewPack (uuid, packUuid, packedJson) {
if (Array.isArray(packedJson)) {
unpackerData.unpacker = new JsonUnpacker();
}
else if (packedJson.type === TextureUnpacker.ID) {
else if (packedJson.type === cc.js._getClassId(cc.Texture2D)) {
unpackerData.unpacker = new TextureUnpacker();
}
unpackerData.unpacker.load(packIndices[packUuid], packedJson);
+1 -5
View File
@@ -24,9 +24,6 @@
THE SOFTWARE.
****************************************************************************/
import {Texture2D} from '../assets/texture-2d';
import {_getClassId} from '../core/utils/js';
export class JsonUnpacker {
constructor () {
this.jsons = {};
@@ -54,7 +51,6 @@ export class JsonUnpacker {
export class TextureUnpacker {
static ID = _getClassId(Texture2D);
constructor () {
this.contents = {};
}
@@ -77,7 +73,7 @@ export class TextureUnpacker {
var content = this.contents[key];
if (content) {
return {
__type__: TextureUnpacker.ID,
__type__: cc.js._getClassId(cc.Texture2D),
content: content
};
}