@galacean/engine-physics-physx 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.
@@ -18205,18 +18205,10 @@ var defaultInterval = 500;
18205
18205
  var _config_type;
18206
18206
  config.type = (_config_type = config.type) != null ? _config_type : getMimeTypeFromUrl(url);
18207
18207
  var realRequest = config.type === "image" ? requestImage : requestRes;
18208
- var lastError;
18209
18208
  var executor = new MultiExecutor(function() {
18210
- return realRequest(url, config).onProgress(setProgress).then(function(res) {
18211
- resolve(res);
18212
- executor.stop();
18213
- }).catch(function(err) {
18214
- return lastError = err;
18215
- });
18209
+ return realRequest(url, config).onProgress(setProgress);
18216
18210
  }, retryCount, retryInterval);
18217
- executor.start(function() {
18218
- reject(lastError);
18219
- });
18211
+ executor.start().onError(reject).onComplete(resolve);
18220
18212
  });
18221
18213
  }
18222
18214
  function requestImage(url, config) {
@@ -18303,23 +18295,33 @@ var MultiExecutor = /*#__PURE__*/ function() {
18303
18295
  this.exec = this.exec.bind(this);
18304
18296
  };
18305
18297
  var _proto = MultiExecutor.prototype;
18306
- _proto.start = function start(done) {
18307
- this.done = done;
18298
+ _proto.start = function start() {
18308
18299
  this.exec();
18300
+ return this;
18309
18301
  };
18310
- _proto.stop = function stop() {
18311
- clearTimeout(this._timeoutId);
18302
+ _proto.onComplete = function onComplete(func) {
18303
+ this._onComplete = func;
18304
+ return this;
18305
+ };
18306
+ _proto.onError = function onError(func) {
18307
+ this._onError = func;
18308
+ return this;
18309
+ };
18310
+ _proto.cancel = function cancel() {
18311
+ engineMiniprogramAdapter$2.window.clearTimeout(this._timeoutId);
18312
18312
  };
18313
18313
  _proto.exec = function exec() {
18314
18314
  var _this = this;
18315
18315
  if (this._currentCount >= this.totalCount) {
18316
- this.done && this.done();
18316
+ this._onError && this._onError(this._error);
18317
18317
  return;
18318
18318
  }
18319
18319
  this._currentCount++;
18320
- this.execFunc(this._currentCount).then(function() {
18321
- //@ts-ignore
18322
- _this._timeoutId = setTimeout(_this.exec, _this.interval);
18320
+ this.execFunc(this._currentCount).then(function(result) {
18321
+ return _this._onComplete && _this._onComplete(result);
18322
+ }).catch(function(e) {
18323
+ _this._error = e;
18324
+ _this._timeoutId = engineMiniprogramAdapter$2.window.setTimeout(_this.exec, _this.interval);
18323
18325
  });
18324
18326
  };
18325
18327
  return MultiExecutor;
@@ -27499,8 +27501,14 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
27499
27501
  }
27500
27502
  });
27501
27503
  GLTFParser.defaultPipeline.parse(context).then(masterPromiseInfo.resolve).catch(function(e) {
27502
- console.error(e);
27503
- masterPromiseInfo.reject("Error loading glTF model from " + url + " .");
27504
+ var msg = "Error loading glTF model from " + url + " .";
27505
+ miniprogram$5.Logger.error(msg);
27506
+ masterPromiseInfo.reject(msg);
27507
+ context.defaultSceneRootPromiseInfo.reject(e);
27508
+ context.texturesPromiseInfo.reject(e);
27509
+ context.materialsPromiseInfo.reject(e);
27510
+ context.meshesPromiseInfo.reject(e);
27511
+ context.animationClipsPromiseInfo.reject(e);
27504
27512
  });
27505
27513
  return context.promiseMap;
27506
27514
  };
@@ -29029,7 +29037,7 @@ exports.MeshLoader = /*#__PURE__*/ function(Loader) {
29029
29037
  decode(data, resourceManager.engine).then(function(mesh) {
29030
29038
  resolve(mesh);
29031
29039
  });
29032
- });
29040
+ }).catch(reject);
29033
29041
  });
29034
29042
  };
29035
29043
  return MeshLoader;
@@ -29047,14 +29055,14 @@ exports.EditorTextureLoader = /*#__PURE__*/ function(Loader) {
29047
29055
  var _proto = EditorTextureLoader.prototype;
29048
29056
  _proto.load = function load(item, resourceManager) {
29049
29057
  var _this = this;
29050
- return new miniprogram$5.AssetPromise(function(resolve) {
29058
+ return new miniprogram$5.AssetPromise(function(resolve, reject) {
29051
29059
  _this.request(item.url, {
29052
29060
  type: "arraybuffer"
29053
29061
  }).then(function(data) {
29054
29062
  decode(data, resourceManager.engine).then(function(texture) {
29055
29063
  resolve(texture);
29056
29064
  });
29057
- });
29065
+ }).catch(reject);
29058
29066
  });
29059
29067
  };
29060
29068
  return EditorTextureLoader;
@@ -36249,7 +36257,7 @@ function _interopNamespace(e) {
36249
36257
  }
36250
36258
  var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
36251
36259
  //@ts-ignore
36252
- var version = "0.9.19";
36260
+ var version = "0.9.20";
36253
36261
  console.log("Galacean engine version: " + version);
36254
36262
  for(var key in CoreObjects__namespace){
36255
36263
  CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);