@galacean/effects-core 1.3.1 → 1.3.2

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.
@@ -44,6 +44,8 @@ export declare class CompVFXItem extends VFXItem<void | CalculateItem> {
44
44
  onItemRemoved(composition: Composition): void;
45
45
  reset(): void;
46
46
  handleVisibleChanged(visible: boolean): void;
47
+ setScale(x: number, y: number, z: number): void;
48
+ scale(x: number, y: number, z: number): void;
47
49
  getUpdateTime(t: number): number;
48
50
  removeItem(item: VFXItem<VFXItemContent>): boolean;
49
51
  /**
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: v1.3.1
6
+ * Version: v1.3.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -24096,18 +24096,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24096
24096
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24097
24097
  if (exports.Item.isComposition(itemProps)) {
24098
24098
  var refId = itemProps.content.options.refId;
24099
- var props = this.composition.refCompositionProps.get(refId);
24100
- if (!props) {
24101
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24102
- }
24103
- props.content = itemProps.content;
24104
- item = new CompVFXItem(__assign$1(__assign$1({}, props), { refId: refId, delay: itemProps.delay, id: itemProps.id, name: itemProps.name, duration: itemProps.duration, endBehavior: itemProps.endBehavior, parentId: itemProps.parentId, transform: itemProps.transform }), this.composition);
24099
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24105
24100
  item.contentProps = itemProps.content;
24106
24101
  item.transform.parentTransform = this.transform;
24107
24102
  this.composition.refContent.push(item);
24108
24103
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24109
24104
  this.composition.autoRefTex = false;
24110
24105
  }
24106
+ item.createContent();
24111
24107
  }
24112
24108
  else {
24113
24109
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24239,6 +24235,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24239
24235
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24240
24236
  this.items.forEach(function (item) { return item.setVisible(visible); });
24241
24237
  };
24238
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24239
+ if (this.content) {
24240
+ this.content.startSize = new Vector3(x, y, z);
24241
+ }
24242
+ };
24243
+ CompVFXItem.prototype.scale = function (x, y, z) {
24244
+ if (this.content) {
24245
+ var startSize = this.content.startSize.clone();
24246
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24247
+ }
24248
+ };
24242
24249
  CompVFXItem.prototype.getUpdateTime = function (t) {
24243
24250
  var startTime = this.startTimeInms;
24244
24251
  var now = this.timeInms;