@galacean/effects-threejs 2.1.0-alpha.13 → 2.1.0-alpha.14

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 threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.1.0-alpha.13
6
+ * Version: v2.1.0-alpha.14
7
7
  */
8
8
 
9
9
  'use strict';
@@ -1644,6 +1644,34 @@ var BuiltinObjectGUID = {
1644
1644
  UnlitShader: "unlit000000000000000000000000000"
1645
1645
  };
1646
1646
 
1647
+ /**
1648
+ * 矢量图形类型
1649
+ */ var ShapePrimitiveType;
1650
+ (function(ShapePrimitiveType) {
1651
+ /**
1652
+ * 自定义图形
1653
+ */ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
1654
+ /**
1655
+ * 矩形
1656
+ */ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
1657
+ /**
1658
+ * 椭圆
1659
+ */ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
1660
+ /**
1661
+ * 多边形
1662
+ */ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
1663
+ /**
1664
+ * 星形
1665
+ */ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
1666
+ })(ShapePrimitiveType || (ShapePrimitiveType = {}));
1667
+
1668
+ // 本期无该功能 待补充
1669
+ var ShapeConnectType;
1670
+ (function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
1671
+ // @待补充
1672
+ var ShapePointType;
1673
+ (function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
1674
+
1647
1675
  /**
1648
1676
  * 动态换图类型
1649
1677
  * @since 1.1.0
@@ -1838,6 +1866,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
1838
1866
  get TextWeight () { return TextWeight; },
1839
1867
  get FontStyle () { return FontStyle; },
1840
1868
  BuiltinObjectGUID: BuiltinObjectGUID,
1869
+ get ShapePrimitiveType () { return ShapePrimitiveType; },
1870
+ get ShapeConnectType () { return ShapeConnectType; },
1871
+ get ShapePointType () { return ShapePointType; },
1841
1872
  get BackgroundType () { return BackgroundType; },
1842
1873
  get MultimediaType () { return MultimediaType; },
1843
1874
  get DataType () { return DataType; },
@@ -16165,7 +16196,7 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16165
16196
  this.path.clear();
16166
16197
  var shapeData = data;
16167
16198
  switch(shapeData.type){
16168
- case 0:
16199
+ case ShapePrimitiveType.Custom:
16169
16200
  {
16170
16201
  var customData = shapeData;
16171
16202
  var points = customData.points;
@@ -16202,28 +16233,28 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16202
16233
  }
16203
16234
  break;
16204
16235
  }
16205
- case 2:
16236
+ case ShapePrimitiveType.Ellipse:
16206
16237
  {
16207
16238
  var ellipseData = shapeData;
16208
16239
  this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
16209
16240
  this.setFillColor(ellipseData.fill);
16210
16241
  break;
16211
16242
  }
16212
- case 1:
16243
+ case ShapePrimitiveType.Rectangle:
16213
16244
  {
16214
16245
  var rectangleData = shapeData;
16215
16246
  this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
16216
16247
  this.setFillColor(rectangleData.fill);
16217
16248
  break;
16218
16249
  }
16219
- case 4:
16250
+ case ShapePrimitiveType.Star:
16220
16251
  {
16221
16252
  var starData = shapeData;
16222
16253
  this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
16223
16254
  this.setFillColor(starData.fill);
16224
16255
  break;
16225
16256
  }
16226
- case 3:
16257
+ case ShapePrimitiveType.Polygon:
16227
16258
  {
16228
16259
  var polygonData = shapeData;
16229
16260
  this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
@@ -16255,28 +16286,6 @@ exports.ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
16255
16286
  exports.ShapeComponent = __decorate([
16256
16287
  effectsClass("ShapeComponent")
16257
16288
  ], exports.ShapeComponent);
16258
- exports.ShapePrimitiveType = void 0;
16259
- (function(ShapePrimitiveType) {
16260
- /**
16261
- * 自定义图形
16262
- */ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
16263
- /**
16264
- * 矩形
16265
- */ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
16266
- /**
16267
- * 椭圆
16268
- */ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
16269
- /**
16270
- * 多边形
16271
- */ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
16272
- /**
16273
- * 星形
16274
- */ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
16275
- })(exports.ShapePrimitiveType || (exports.ShapePrimitiveType = {}));
16276
- exports.ShapeConnectType = void 0;
16277
- (function(ShapeConnectType) {})(exports.ShapeConnectType || (exports.ShapeConnectType = {}));
16278
- exports.ShapePointType = void 0;
16279
- (function(ShapePointType) {})(exports.ShapePointType || (exports.ShapePointType = {}));
16280
16289
 
16281
16290
  exports.Fake3DComponent = /*#__PURE__*/ function(Component) {
16282
16291
  _inherits(Fake3DComponent, Component);
@@ -18889,9 +18898,18 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
18889
18898
  }
18890
18899
  };
18891
18900
  _proto.onDestroy = function onDestroy() {
18901
+ var textures = this.getTextures();
18892
18902
  if (this.item && this.item.composition) {
18893
- this.item.composition.destroyTextures(this.getTextures());
18903
+ this.item.composition.destroyTextures(textures);
18894
18904
  }
18905
+ textures.forEach(function(texture) {
18906
+ var source = texture.source;
18907
+ if (source.sourceType === exports.TextureSourceType.video && (source == null ? void 0 : source.video)) {
18908
+ source.video.pause();
18909
+ source.video.src = "";
18910
+ source.video.load();
18911
+ }
18912
+ });
18895
18913
  };
18896
18914
  _proto.createGeometry = function createGeometry(mode) {
18897
18915
  var maxVertex = 12 * this.splits.length;
@@ -24884,7 +24902,7 @@ var TextLayout = /*#__PURE__*/ function() {
24884
24902
  function TextLayout(options) {
24885
24903
  this.width = 0;
24886
24904
  this.height = 0;
24887
- var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, text = options.text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
24905
+ var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
24888
24906
  var tempWidth = fontSize + letterSpace;
24889
24907
  this.autoWidth = autoWidth;
24890
24908
  this.maxTextWidth = text.length * tempWidth;
@@ -29060,16 +29078,15 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
29060
29078
  if (pause) {
29061
29079
  this.resume();
29062
29080
  }
29063
- if (!this.rootComposition.isStartCalled) {
29064
- this.rootComposition.onStart();
29065
- this.rootComposition.isStartCalled = true;
29066
- }
29067
29081
  this.setSpeed(1);
29068
29082
  this.forwardTime(time + this.startTime);
29069
29083
  this.setSpeed(speed);
29070
29084
  if (pause) {
29071
29085
  this.pause();
29072
29086
  }
29087
+ this.emit("goto", {
29088
+ time: time
29089
+ });
29073
29090
  };
29074
29091
  _proto.addItem = function addItem(item) {
29075
29092
  this.items.push(item);
@@ -31609,7 +31626,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem, true);
31609
31626
  registerPlugin("particle", ParticleLoader, exports.VFXItem, true);
31610
31627
  registerPlugin("cal", CalculateLoader, exports.VFXItem, true);
31611
31628
  registerPlugin("interact", InteractLoader, exports.VFXItem, true);
31612
- var version$1 = "2.1.0-alpha.13";
31629
+ var version$1 = "2.1.0-alpha.14";
31613
31630
  logger.info("Core version: " + version$1 + ".");
31614
31631
 
31615
31632
  var _obj;
@@ -33236,7 +33253,7 @@ setMaxSpriteMeshItemCount(8);
33236
33253
  */ Mesh.create = function(engine, props) {
33237
33254
  return new ThreeMesh(engine, props);
33238
33255
  };
33239
- var version = "2.1.0-alpha.13";
33256
+ var version = "2.1.0-alpha.14";
33240
33257
  logger.info("THREEJS plugin version: " + version + ".");
33241
33258
 
33242
33259
  exports.AbstractPlugin = AbstractPlugin;