mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 03:22:39 +08:00
fix circular dependency (#4616)
This commit is contained in:
committed by
Weiliang Wang
parent
292584e557
commit
e7f1af7d8d
@@ -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);
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user