@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 CHANGED
@@ -24148,7 +24148,6 @@ PrimitiveChunk.subMeshPool = new ReturnableObjectPool(SubMesh, 10);
24148
24148
  /** Sprite Atlas. */ AssetType["SpriteAtlas"] = "SpriteAtlas";
24149
24149
  /** Ambient light. */ AssetType["Env"] = "Environment";
24150
24150
  /** Scene. */ AssetType["Scene"] = "Scene";
24151
- /** HDR to cube. */ AssetType["HDR"] = "HDR";
24152
24151
  /** Font. */ AssetType["Font"] = "Font";
24153
24152
  /** Source Font, include ttf, otf and woff. */ AssetType["SourceFont"] = "SourceFont";
24154
24153
  /** AudioClip, include ogg, wav and mp3. */ AssetType["Audio"] = "Audio";
@@ -24568,7 +24567,6 @@ var MultiExecutor = /*#__PURE__*/ function() {
24568
24567
  this._subAssetPromiseCallbacks = {};
24569
24568
  this.//-----------------Editor temp solution-----------------
24570
24569
  /** @internal */ _objectPool = Object.create(null);
24571
- this./** @internal */ _idResourceMap = Object.create(null);
24572
24570
  this./** @internal */ _virtualPathResourceMap = Object.create(null);
24573
24571
  }
24574
24572
  var _proto = ResourceManager.prototype;
@@ -24969,30 +24967,29 @@ var MultiExecutor = /*#__PURE__*/ function() {
24969
24967
  * @internal
24970
24968
  * @beta Just for internal editor, not recommended for developers.
24971
24969
  */ _proto.getResourceByRef = function getResourceByRef(ref) {
24972
- var refId = ref.refId, key = ref.key, isClone = ref.isClone;
24973
- var obj = this._objectPool[refId];
24974
- var promise;
24975
- if (obj) {
24976
- promise = AssetPromise.resolve(obj);
24977
- } else {
24978
- var resourceConfig = this._idResourceMap[refId];
24979
- if (!resourceConfig) {
24980
- Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
24981
- return AssetPromise.resolve(null);
24982
- }
24983
- var url = resourceConfig.virtualPath;
24984
- if (key) {
24985
- url += "?q=" + key;
24986
- }
24987
- promise = this.load({
24988
- url: url,
24989
- type: resourceConfig.type,
24990
- params: resourceConfig.params
24991
- });
24992
- }
24993
- return promise.then(function(item) {
24994
- return isClone ? item.clone() : item;
24970
+ var url = ref.url, key = ref.key, isClone = ref.isClone;
24971
+ if (!url) {
24972
+ Logger.warn("ResourceManager.getResourceByRef: url is empty.");
24973
+ return AssetPromise.resolve(null);
24974
+ }
24975
+ var cached = this._objectPool[url];
24976
+ if (cached) {
24977
+ return AssetPromise.resolve(isClone ? cached.clone() : cached);
24978
+ }
24979
+ var mapped = this._virtualPathResourceMap[url];
24980
+ if (!mapped) {
24981
+ Logger.warn('ResourceManager.getResourceByRef: url "' + url + '" not found in virtualPathResourceMap.');
24982
+ return AssetPromise.resolve(null);
24983
+ }
24984
+ var loadUrl = key ? url + "?q=" + key : url;
24985
+ var promise = this.load({
24986
+ url: loadUrl,
24987
+ type: mapped.type,
24988
+ params: mapped.params
24995
24989
  });
24990
+ return isClone ? promise.then(function(item) {
24991
+ return item.clone();
24992
+ }) : promise;
24996
24993
  };
24997
24994
  /**
24998
24995
  * @internal
@@ -25001,7 +24998,6 @@ var MultiExecutor = /*#__PURE__*/ function() {
25001
24998
  var _this = this;
25002
24999
  config.forEach(function(element) {
25003
25000
  _this._virtualPathResourceMap[element.virtualPath] = element;
25004
- _this._idResourceMap[element.id] = element;
25005
25001
  if (element.dependentAssetMap) {
25006
25002
  _this._virtualPathResourceMap[element.virtualPath].dependentAssetMap = element.dependentAssetMap;
25007
25003
  }