@galacean/engine-core 0.9.0-beta.80 → 0.9.0-beta.81

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.
@@ -2192,6 +2192,21 @@ var /** @internal */ PromiseState;
2192
2192
  });
2193
2193
  return AssetPromise.all(promises);
2194
2194
  };
2195
+ /**
2196
+ * Get the resource from cache by asset url, return the resource object if it loaded, otherwise return null.
2197
+ * @param url - Resource url
2198
+ * @returns Resource object
2199
+ */ _proto.getFromCache = function getFromCache(url) {
2200
+ var _this__assetUrlPool_url;
2201
+ return (_this__assetUrlPool_url = this._assetUrlPool[url]) != null ? _this__assetUrlPool_url : null;
2202
+ };
2203
+ /**
2204
+ * Get asset url from instanceId.
2205
+ * @param instanceId - Engine instance id
2206
+ * @returns Asset url
2207
+ */ _proto.getAssetPath = function getAssetPath(instanceId) {
2208
+ return this._assetPool[instanceId];
2209
+ };
2195
2210
  _proto.cancelNotLoaded = function cancelNotLoaded(url) {
2196
2211
  var _this = this;
2197
2212
  if (!url) {
@@ -2215,13 +2230,6 @@ var /** @internal */ PromiseState;
2215
2230
  this._gc(false);
2216
2231
  };
2217
2232
  /**
2218
- * Get asset url from instanceId.
2219
- * @param instanceId - Engine instance id
2220
- * @returns Asset url
2221
- */ _proto.getAssetPath = function getAssetPath(instanceId) {
2222
- return this._assetPool[instanceId];
2223
- };
2224
- /**
2225
2233
  * @internal
2226
2234
  */ _proto._addAsset = function _addAsset(path, asset) {
2227
2235
  this._assetPool[asset.instanceId] = path;
@@ -19014,7 +19022,6 @@ exports.TextVerticalAlignment = void 0;
19014
19022
  * @returns Cloned sprite
19015
19023
  */ _proto.clone = function clone() {
19016
19024
  var cloneSprite = new Sprite(this._engine, this._texture, this._region, this._pivot, this._border, this.name);
19017
- cloneSprite._assetID = this._assetID;
19018
19025
  cloneSprite._atlasRotated = this._atlasRotated;
19019
19026
  cloneSprite._atlasRegion.copyFrom(this._atlasRegion);
19020
19027
  cloneSprite._atlasRegionOffset.copyFrom(this._atlasRegionOffset);
package/dist/module.js CHANGED
@@ -2187,6 +2187,21 @@ var /** @internal */ PromiseState;
2187
2187
  });
2188
2188
  return AssetPromise.all(promises);
2189
2189
  };
2190
+ /**
2191
+ * Get the resource from cache by asset url, return the resource object if it loaded, otherwise return null.
2192
+ * @param url - Resource url
2193
+ * @returns Resource object
2194
+ */ _proto.getFromCache = function getFromCache(url) {
2195
+ var _this__assetUrlPool_url;
2196
+ return (_this__assetUrlPool_url = this._assetUrlPool[url]) != null ? _this__assetUrlPool_url : null;
2197
+ };
2198
+ /**
2199
+ * Get asset url from instanceId.
2200
+ * @param instanceId - Engine instance id
2201
+ * @returns Asset url
2202
+ */ _proto.getAssetPath = function getAssetPath(instanceId) {
2203
+ return this._assetPool[instanceId];
2204
+ };
2190
2205
  _proto.cancelNotLoaded = function cancelNotLoaded(url) {
2191
2206
  var _this = this;
2192
2207
  if (!url) {
@@ -2210,13 +2225,6 @@ var /** @internal */ PromiseState;
2210
2225
  this._gc(false);
2211
2226
  };
2212
2227
  /**
2213
- * Get asset url from instanceId.
2214
- * @param instanceId - Engine instance id
2215
- * @returns Asset url
2216
- */ _proto.getAssetPath = function getAssetPath(instanceId) {
2217
- return this._assetPool[instanceId];
2218
- };
2219
- /**
2220
2228
  * @internal
2221
2229
  */ _proto._addAsset = function _addAsset(path, asset) {
2222
2230
  this._assetPool[asset.instanceId] = path;
@@ -19009,7 +19017,6 @@ var TextVerticalAlignment;
19009
19017
  * @returns Cloned sprite
19010
19018
  */ _proto.clone = function clone() {
19011
19019
  var cloneSprite = new Sprite(this._engine, this._texture, this._region, this._pivot, this._border, this.name);
19012
- cloneSprite._assetID = this._assetID;
19013
19020
  cloneSprite._atlasRotated = this._atlasRotated;
19014
19021
  cloneSprite._atlasRegion.copyFrom(this._atlasRegion);
19015
19022
  cloneSprite._atlasRegionOffset.copyFrom(this._atlasRegionOffset);