@galacean/engine-core 2.0.0-alpha.5 → 2.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +22 -26
- package/dist/main.js.map +1 -1
- package/dist/module.js +22 -26
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/asset/AssetType.d.ts +0 -2
package/dist/module.js
CHANGED
|
@@ -24144,7 +24144,6 @@ PrimitiveChunk.subMeshPool = new ReturnableObjectPool(SubMesh, 10);
|
|
|
24144
24144
|
/** Sprite Atlas. */ AssetType["SpriteAtlas"] = "SpriteAtlas";
|
|
24145
24145
|
/** Ambient light. */ AssetType["Env"] = "Environment";
|
|
24146
24146
|
/** Scene. */ AssetType["Scene"] = "Scene";
|
|
24147
|
-
/** HDR to cube. */ AssetType["HDR"] = "HDR";
|
|
24148
24147
|
/** Font. */ AssetType["Font"] = "Font";
|
|
24149
24148
|
/** Source Font, include ttf, otf and woff. */ AssetType["SourceFont"] = "SourceFont";
|
|
24150
24149
|
/** AudioClip, include ogg, wav and mp3. */ AssetType["Audio"] = "Audio";
|
|
@@ -24564,7 +24563,6 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
24564
24563
|
this._subAssetPromiseCallbacks = {};
|
|
24565
24564
|
this.//-----------------Editor temp solution-----------------
|
|
24566
24565
|
/** @internal */ _objectPool = Object.create(null);
|
|
24567
|
-
this./** @internal */ _idResourceMap = Object.create(null);
|
|
24568
24566
|
this./** @internal */ _virtualPathResourceMap = Object.create(null);
|
|
24569
24567
|
}
|
|
24570
24568
|
var _proto = ResourceManager.prototype;
|
|
@@ -24965,30 +24963,29 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
24965
24963
|
* @internal
|
|
24966
24964
|
* @beta Just for internal editor, not recommended for developers.
|
|
24967
24965
|
*/ _proto.getResourceByRef = function getResourceByRef(ref) {
|
|
24968
|
-
var
|
|
24969
|
-
|
|
24970
|
-
|
|
24971
|
-
|
|
24972
|
-
|
|
24973
|
-
|
|
24974
|
-
|
|
24975
|
-
|
|
24976
|
-
|
|
24977
|
-
|
|
24978
|
-
|
|
24979
|
-
|
|
24980
|
-
|
|
24981
|
-
|
|
24982
|
-
|
|
24983
|
-
|
|
24984
|
-
|
|
24985
|
-
|
|
24986
|
-
|
|
24987
|
-
});
|
|
24988
|
-
}
|
|
24989
|
-
return promise.then(function(item) {
|
|
24990
|
-
return isClone ? item.clone() : item;
|
|
24966
|
+
var url = ref.url, key = ref.key, isClone = ref.isClone;
|
|
24967
|
+
if (!url) {
|
|
24968
|
+
Logger.warn("ResourceManager.getResourceByRef: url is empty.");
|
|
24969
|
+
return AssetPromise.resolve(null);
|
|
24970
|
+
}
|
|
24971
|
+
var cached = this._objectPool[url];
|
|
24972
|
+
if (cached) {
|
|
24973
|
+
return AssetPromise.resolve(isClone ? cached.clone() : cached);
|
|
24974
|
+
}
|
|
24975
|
+
var mapped = this._virtualPathResourceMap[url];
|
|
24976
|
+
if (!mapped) {
|
|
24977
|
+
Logger.warn('ResourceManager.getResourceByRef: url "' + url + '" not found in virtualPathResourceMap.');
|
|
24978
|
+
return AssetPromise.resolve(null);
|
|
24979
|
+
}
|
|
24980
|
+
var loadUrl = key ? url + "?q=" + key : url;
|
|
24981
|
+
var promise = this.load({
|
|
24982
|
+
url: loadUrl,
|
|
24983
|
+
type: mapped.type,
|
|
24984
|
+
params: mapped.params
|
|
24991
24985
|
});
|
|
24986
|
+
return isClone ? promise.then(function(item) {
|
|
24987
|
+
return item.clone();
|
|
24988
|
+
}) : promise;
|
|
24992
24989
|
};
|
|
24993
24990
|
/**
|
|
24994
24991
|
* @internal
|
|
@@ -24997,7 +24994,6 @@ var MultiExecutor = /*#__PURE__*/ function() {
|
|
|
24997
24994
|
var _this = this;
|
|
24998
24995
|
config.forEach(function(element) {
|
|
24999
24996
|
_this._virtualPathResourceMap[element.virtualPath] = element;
|
|
25000
|
-
_this._idResourceMap[element.id] = element;
|
|
25001
24997
|
if (element.dependentAssetMap) {
|
|
25002
24998
|
_this._virtualPathResourceMap[element.virtualPath].dependentAssetMap = element.dependentAssetMap;
|
|
25003
24999
|
}
|