@galacean/effects-core 2.6.0-alpha.1 → 2.6.0-beta.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.
@@ -27,6 +27,16 @@ export type CompositionEvent<C> = {
27
27
  compositionId: string;
28
28
  }
29
29
  ];
30
+ /**
31
+ * 合成开始播放事件
32
+ */
33
+ ['play']: [playInfo: {
34
+ time: number;
35
+ }];
36
+ /**
37
+ * 合成暂停事件
38
+ */
39
+ ['pause']: [];
30
40
  /**
31
41
  * 合成结束事件
32
42
  * 合成行为为循环时每次循环结束都会触发
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime core for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.6.0-alpha.1
6
+ * Version: v2.6.0-beta.1
7
7
  */
8
8
 
9
9
  'use strict';
@@ -1077,7 +1077,8 @@ function _inherits(subClass, superClass) {
1077
1077
  JSONSceneVersion["3_1"] = "3.1";
1078
1078
  JSONSceneVersion["3_2"] = "3.2";
1079
1079
  JSONSceneVersion["3_3"] = "3.3";
1080
- JSONSceneVersion["LATEST"] = "3.3";
1080
+ JSONSceneVersion["3_4"] = "3.4";
1081
+ JSONSceneVersion["LATEST"] = "3.4";
1081
1082
  })(JSONSceneVersion || (JSONSceneVersion = {}));
1082
1083
 
1083
1084
  /*********************************************/ /* 元素属性参数类型 */ /*********************************************/ /**
@@ -5583,7 +5584,7 @@ var Skeleton = /*#__PURE__*/ function() {
5583
5584
  };
5584
5585
  _proto.addRecordedProperty = function addRecordedProperty(path, className, property, type) {
5585
5586
  var totalPath = path + className + property;
5586
- if (this.pathToObjectIndex.get(totalPath)) {
5587
+ if (this.pathToObjectIndex.get(totalPath) !== undefined) {
5587
5588
  return;
5588
5589
  }
5589
5590
  var targetBone = this.findTarget(path);
@@ -8300,8 +8301,8 @@ function initGLContext() {
8300
8301
  copy(WebGLRenderingContext);
8301
8302
  copy(WebGLRenderingContext.prototype);
8302
8303
  } else {
8303
- initErrors.push(// iOS 16 lockdown mode
8304
- "iOS16 lockdown mode, WebGL Constants not in global");
8304
+ initErrors.push(isIOS() ? // iOS 16 lockdown mode
8305
+ "iOS16 lockdown mode, WebGL Constants not in global" : "WebGL Constants not in global, please check your environment");
8305
8306
  }
8306
8307
  if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
8307
8308
  // @ts-expect-error set default value
@@ -8910,7 +8911,9 @@ function _loadVideo() {
8910
8911
  return [
8911
8912
  2,
8912
8913
  new Promise(function(resolve, reject) {
8913
- var pending = video.play();
8914
+ var pending = video.play().catch(function(e) {
8915
+ reject(e);
8916
+ });
8914
8917
  if (pending) {
8915
8918
  void pending.then(function() {
8916
8919
  return resolve(video);
@@ -23976,6 +23979,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
23976
23979
  * 暂停合成的播放
23977
23980
  */ _proto.pause = function pause() {
23978
23981
  this.paused = true;
23982
+ this.emit("pause");
23979
23983
  };
23980
23984
  /**
23981
23985
  *
@@ -23994,6 +23998,9 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
23994
23998
  */ _proto.gotoAndPlay = function gotoAndPlay(time) {
23995
23999
  this.setTime(time);
23996
24000
  this.resume();
24001
+ this.emit("play", {
24002
+ time: time
24003
+ });
23997
24004
  };
23998
24005
  /**
23999
24006
  * 跳转合成到指定时间并暂停
@@ -24028,7 +24035,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
24028
24035
  this.forwardTime(time + this.startTime);
24029
24036
  this.setSpeed(speed);
24030
24037
  if (pause) {
24031
- this.pause();
24038
+ this.paused = true;
24032
24039
  }
24033
24040
  this.emit("goto", {
24034
24041
  time: time
@@ -25467,7 +25474,11 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
25467
25474
  dy
25468
25475
  ]);
25469
25476
  }
25470
- this.time += dt / 1000;
25477
+ this.time = time + dt / 1000;
25478
+ };
25479
+ _proto.onDisable = function onDisable() {
25480
+ BaseRenderComponent.prototype.onDisable.call(this);
25481
+ this.time = 0;
25471
25482
  };
25472
25483
  _proto.onDestroy = function onDestroy() {
25473
25484
  var texture = this.renderer.texture;
@@ -31039,7 +31050,7 @@ function getStandardSpriteContent(sprite, transform) {
31039
31050
  return ret;
31040
31051
  }
31041
31052
 
31042
- var version$1 = "2.6.0-alpha.1";
31053
+ var version$1 = "2.6.0-beta.1";
31043
31054
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
31044
31055
  var standardVersion = /^(\d+)\.(\d+)$/;
31045
31056
  var reverseParticle = false;
@@ -34289,7 +34300,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
34289
34300
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
34290
34301
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
34291
34302
  registerPlugin("interact", InteractLoader, exports.VFXItem);
34292
- var version = "2.6.0-alpha.1";
34303
+ var version = "2.6.0-beta.1";
34293
34304
  logger.info("Core version: " + version + ".");
34294
34305
 
34295
34306
  exports.AbstractPlugin = AbstractPlugin;