@galacean/engine-physics-lite 0.9.19 → 0.9.20

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.
@@ -18212,18 +18212,10 @@ var defaultInterval = 500;
18212
18212
  var _config_type;
18213
18213
  config.type = (_config_type = config.type) != null ? _config_type : getMimeTypeFromUrl(url);
18214
18214
  var realRequest = config.type === "image" ? requestImage : requestRes;
18215
- var lastError;
18216
18215
  var executor = new MultiExecutor(function() {
18217
- return realRequest(url, config).onProgress(setProgress).then(function(res) {
18218
- resolve(res);
18219
- executor.stop();
18220
- }).catch(function(err) {
18221
- return lastError = err;
18222
- });
18216
+ return realRequest(url, config).onProgress(setProgress);
18223
18217
  }, retryCount, retryInterval);
18224
- executor.start(function() {
18225
- reject(lastError);
18226
- });
18218
+ executor.start().onError(reject).onComplete(resolve);
18227
18219
  });
18228
18220
  }
18229
18221
  function requestImage(url, config) {
@@ -18310,23 +18302,33 @@ var MultiExecutor = /*#__PURE__*/ function() {
18310
18302
  this.exec = this.exec.bind(this);
18311
18303
  };
18312
18304
  var _proto = MultiExecutor.prototype;
18313
- _proto.start = function start(done) {
18314
- this.done = done;
18305
+ _proto.start = function start() {
18315
18306
  this.exec();
18307
+ return this;
18316
18308
  };
18317
- _proto.stop = function stop() {
18318
- clearTimeout(this._timeoutId);
18309
+ _proto.onComplete = function onComplete(func) {
18310
+ this._onComplete = func;
18311
+ return this;
18312
+ };
18313
+ _proto.onError = function onError(func) {
18314
+ this._onError = func;
18315
+ return this;
18316
+ };
18317
+ _proto.cancel = function cancel() {
18318
+ engineMiniprogramAdapter$2.window.clearTimeout(this._timeoutId);
18319
18319
  };
18320
18320
  _proto.exec = function exec() {
18321
18321
  var _this = this;
18322
18322
  if (this._currentCount >= this.totalCount) {
18323
- this.done && this.done();
18323
+ this._onError && this._onError(this._error);
18324
18324
  return;
18325
18325
  }
18326
18326
  this._currentCount++;
18327
- this.execFunc(this._currentCount).then(function() {
18328
- //@ts-ignore
18329
- _this._timeoutId = setTimeout(_this.exec, _this.interval);
18327
+ this.execFunc(this._currentCount).then(function(result) {
18328
+ return _this._onComplete && _this._onComplete(result);
18329
+ }).catch(function(e) {
18330
+ _this._error = e;
18331
+ _this._timeoutId = engineMiniprogramAdapter$2.window.setTimeout(_this.exec, _this.interval);
18330
18332
  });
18331
18333
  };
18332
18334
  return MultiExecutor;
@@ -27506,8 +27508,14 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
27506
27508
  }
27507
27509
  });
27508
27510
  GLTFParser.defaultPipeline.parse(context).then(masterPromiseInfo.resolve).catch(function(e) {
27509
- console.error(e);
27510
- masterPromiseInfo.reject("Error loading glTF model from " + url + " .");
27511
+ var msg = "Error loading glTF model from " + url + " .";
27512
+ miniprogram$5.Logger.error(msg);
27513
+ masterPromiseInfo.reject(msg);
27514
+ context.defaultSceneRootPromiseInfo.reject(e);
27515
+ context.texturesPromiseInfo.reject(e);
27516
+ context.materialsPromiseInfo.reject(e);
27517
+ context.meshesPromiseInfo.reject(e);
27518
+ context.animationClipsPromiseInfo.reject(e);
27511
27519
  });
27512
27520
  return context.promiseMap;
27513
27521
  };
@@ -29036,7 +29044,7 @@ exports.MeshLoader = /*#__PURE__*/ function(Loader) {
29036
29044
  decode(data, resourceManager.engine).then(function(mesh) {
29037
29045
  resolve(mesh);
29038
29046
  });
29039
- });
29047
+ }).catch(reject);
29040
29048
  });
29041
29049
  };
29042
29050
  return MeshLoader;
@@ -29054,14 +29062,14 @@ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
29054
29062
  var _proto = EditorTextureLoader.prototype;
29055
29063
  _proto.load = function load(item, resourceManager) {
29056
29064
  var _this = this;
29057
- return new miniprogram$5.AssetPromise(function(resolve) {
29065
+ return new miniprogram$5.AssetPromise(function(resolve, reject) {
29058
29066
  _this.request(item.url, {
29059
29067
  type: "arraybuffer"
29060
29068
  }).then(function(data) {
29061
29069
  decode(data, resourceManager.engine).then(function(texture) {
29062
29070
  resolve(texture);
29063
29071
  });
29064
- });
29072
+ }).catch(reject);
29065
29073
  });
29066
29074
  };
29067
29075
  return EditorTextureLoader;
@@ -36256,7 +36264,7 @@ function _interopNamespace(e) {
36256
36264
  }
36257
36265
  var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
36258
36266
  //@ts-ignore
36259
- var version = "0.9.19";
36267
+ var version = "0.9.20";
36260
36268
  console.log("Galacean engine version: " + version);
36261
36269
  for(var key in CoreObjects__namespace){
36262
36270
  CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);