@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/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 refId = ref.refId, key = ref.key, isClone = ref.isClone;
24969
- var obj = this._objectPool[refId];
24970
- var promise;
24971
- if (obj) {
24972
- promise = AssetPromise.resolve(obj);
24973
- } else {
24974
- var resourceConfig = this._idResourceMap[refId];
24975
- if (!resourceConfig) {
24976
- Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
24977
- return AssetPromise.resolve(null);
24978
- }
24979
- var url = resourceConfig.virtualPath;
24980
- if (key) {
24981
- url += "?q=" + key;
24982
- }
24983
- promise = this.load({
24984
- url: url,
24985
- type: resourceConfig.type,
24986
- params: resourceConfig.params
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
  }