@galacean/effects 1.0.0 → 1.0.1

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime player for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v1.0.0
6
+ * Version: v1.0.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -9457,6 +9457,7 @@ var Transform = /** @class */ (function () {
9457
9457
  */
9458
9458
  Transform.prototype.rotateByQuat = function (quat) {
9459
9459
  quatMultiply(this.quat, this.quat, quat);
9460
+ rotationFromMat3(this.rotation, mat3FromQuat(tempMat3$3, quat));
9460
9461
  this.dirtyFlags.localData = true;
9461
9462
  this.dispatchValueChange();
9462
9463
  };
@@ -10283,7 +10284,7 @@ var PluginSystem = /** @class */ (function () {
10283
10284
  .map(function (name) {
10284
10285
  var CTRL = pluginLoaderMap[name];
10285
10286
  if (!CTRL) {
10286
- throw new Error("plugin '".concat(name, "' not found"));
10287
+ throw new Error("plugin '".concat(name, "' not found.") + getPluginUsageInfo(name));
10287
10288
  }
10288
10289
  var loader = new CTRL();
10289
10290
  loader.name = name;
@@ -10355,6 +10356,23 @@ var PluginSystem = /** @class */ (function () {
10355
10356
  };
10356
10357
  return PluginSystem;
10357
10358
  }());
10359
+ var pluginInfoMap = {
10360
+ 'alipay-downgrade': '@galacean/effects-plugin-alipay-downgrade',
10361
+ 'editor-gizmo': '@galacean/effects-plugin-editor-gizmo',
10362
+ 'tree': '@galacean/effects-plugin-model',
10363
+ 'model': '@galacean/effects-plugin-model',
10364
+ 'orientation-transformer': '@galacean/effects-plugin-orientation-transformer',
10365
+ 'spine': '@galacean/effects-plugin-spine',
10366
+ };
10367
+ function getPluginUsageInfo(name) {
10368
+ var info = pluginInfoMap[name];
10369
+ if (info) {
10370
+ return "\nInstall Plugin: npm i ".concat(info, "@latest --save\nImport Plugin: import '").concat(info, "'");
10371
+ }
10372
+ else {
10373
+ return '';
10374
+ }
10375
+ }
10358
10376
 
10359
10377
  /**
10360
10378
  * 抽象插件类
@@ -30945,11 +30963,15 @@ var Player = /** @class */ (function () {
30945
30963
  }
30946
30964
  this.canvas.remove();
30947
30965
  }
30948
- this.tick = throwDestroyedError;
30949
- this.resize = throwDestroyedError;
30950
- this.loadScene = throwDestroyedErrorPromise;
30951
- this.play = throwDestroyedErrorPromise;
30952
- this.resume = throwDestroyedErrorPromise;
30966
+ // 在报错函数中传入 player.name
30967
+ var errorMsg = getDestroyedErrorMessage(this.name);
30968
+ var throwErrorFunc = function () { return throwDestroyedError(errorMsg); };
30969
+ var throwErrorPromiseFunc = function () { return throwDestroyedErrorPromise(errorMsg); };
30970
+ this.tick = throwErrorFunc;
30971
+ this.resize = throwErrorFunc;
30972
+ this.loadScene = throwErrorPromiseFunc;
30973
+ this.play = throwErrorPromiseFunc;
30974
+ this.resume = throwErrorPromiseFunc;
30953
30975
  this.disposed = true;
30954
30976
  };
30955
30977
  Player.prototype.offloadTexture = function () {
@@ -31074,11 +31096,13 @@ function assertContainer(container) {
31074
31096
  throw new Error("Container is not an HTMLElement, see ".concat(HELP_LINK['Container is not an HTMLElement']));
31075
31097
  }
31076
31098
  }
31077
- var destroyedErrorMessage = "Never use destroyed player again, see ".concat(HELP_LINK['Never use destroyed player again']);
31078
- function throwDestroyedError() {
31099
+ function getDestroyedErrorMessage(name) {
31100
+ return "Never use destroyed player: ".concat(name, " again, see ").concat(HELP_LINK['Never use destroyed player again']);
31101
+ }
31102
+ function throwDestroyedError(destroyedErrorMessage) {
31079
31103
  throw new Error(destroyedErrorMessage);
31080
31104
  }
31081
- function throwDestroyedErrorPromise() {
31105
+ function throwDestroyedErrorPromise(destroyedErrorMessage) {
31082
31106
  return Promise.reject(destroyedErrorMessage);
31083
31107
  }
31084
31108
 
@@ -31124,9 +31148,9 @@ Renderer.create = function (canvas, framework, renderOptions) {
31124
31148
  Engine.create = function (gl) {
31125
31149
  return new GLEngine(gl);
31126
31150
  };
31127
- var version = "1.0.0";
31151
+ var version = "1.0.1";
31128
31152
  console.info({
31129
- content: '[Galacean Effects Player] version: ' + "1.0.0",
31153
+ content: '[Galacean Effects Player] version: ' + "1.0.1",
31130
31154
  type: LOG_TYPE,
31131
31155
  });
31132
31156