From e7f1af7d8de9475f94bd33a27d8b1b0fbaa69d2e Mon Sep 17 00:00:00 2001 From: Santy-Wang Date: Thu, 13 Jun 2019 17:11:10 +0800 Subject: [PATCH] fix circular dependency (#4616) --- cocos/load-pipeline/pack-downloader.js | 2 +- cocos/load-pipeline/unpackers.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cocos/load-pipeline/pack-downloader.js b/cocos/load-pipeline/pack-downloader.js index 0f27634130..508aefe0be 100644 --- a/cocos/load-pipeline/pack-downloader.js +++ b/cocos/load-pipeline/pack-downloader.js @@ -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); diff --git a/cocos/load-pipeline/unpackers.js b/cocos/load-pipeline/unpackers.js index 0ab477ecbf..5e45f82ac7 100644 --- a/cocos/load-pipeline/unpackers.js +++ b/cocos/load-pipeline/unpackers.js @@ -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 }; }