@galacean/effects-plugin-editor-gizmo 2.7.0-alpha.2 → 2.7.0

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.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player editor gizmo plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 茂安,旻诺
6
- * Version: v2.7.0-alpha.2
6
+ * Version: v2.7.0
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -2773,6 +2773,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
2773
2773
  _this.coordinateSpace = 0;
2774
2774
  _this.mat = Matrix4.fromIdentity();
2775
2775
  _this.wireframeMeshes = [];
2776
+ _this.mesh = null;
2776
2777
  /**
2777
2778
  * 射线检测算法
2778
2779
  * @returns 包含射线检测算法回调方法的参数
@@ -3066,9 +3067,9 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3066
3067
  var item = this.item;
3067
3068
  var gizmoSubType = this.subType;
3068
3069
  if (gizmoSubType === GizmoSubType.particleEmitter) {
3069
- if (this.targetItem && item.content) {
3070
+ if (this.targetItem && this.mesh) {
3070
3071
  this.mat = this.targetItem.transform.getWorldMatrix();
3071
- item.content.material.setMatrix("u_model", this.mat);
3072
+ this.mesh.material.setMatrix("u_model", this.mat);
3072
3073
  }
3073
3074
  if (this.wireframeMesh && this.targetItem) {
3074
3075
  var particle = this.targetItem.getComponent(ParticleSystemRenderer);
@@ -3167,7 +3168,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3167
3168
  }
3168
3169
  }
3169
3170
  }
3170
- if (item.content) {
3171
+ if (this.mesh) {
3171
3172
  var worldPos1 = new Vector3();
3172
3173
  var worldQuat1 = new Quaternion();
3173
3174
  var worldSca = new Vector3(1, 1, 1);
@@ -3186,7 +3187,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3186
3187
  targetTransform1.setPosition(newPos1.x, newPos1.y, newPos1.z);
3187
3188
  }
3188
3189
  this.mat = targetTransform1.getWorldMatrix();
3189
- item.content.material.setMatrix("u_model", targetTransform1.getWorldMatrix());
3190
+ this.mesh.material.setMatrix("u_model", targetTransform1.getWorldMatrix());
3190
3191
  }
3191
3192
  }
3192
3193
  }
@@ -3277,7 +3278,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3277
3278
  assertExist(engine);
3278
3279
  this.targetItem = item;
3279
3280
  if (shape && shape.type) {
3280
- var mesh = this.item._content = createMeshFromShape(engine, shape, {
3281
+ var mesh = this.mesh = createMeshFromShape(engine, shape, {
3281
3282
  color: this.color
3282
3283
  });
3283
3284
  meshesToAdd.push(mesh);
@@ -3301,7 +3302,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3301
3302
  assertExist(engine);
3302
3303
  this.targetItem = item;
3303
3304
  if (shape) {
3304
- var mesh = gizmoItem._content = createMeshFromShape(engine, shape, {
3305
+ var mesh = this.mesh = createMeshFromShape(engine, shape, {
3305
3306
  color: this.color,
3306
3307
  depthTest: this.depthTest
3307
3308
  });
@@ -3324,7 +3325,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3324
3325
  };
3325
3326
  var engine = (_gizmoItem_composition = gizmoItem.composition) == null ? void 0 : _gizmoItem_composition.renderer.engine;
3326
3327
  assertExist(engine);
3327
- var mesh = gizmoItem._content = createMeshFromSubType(engine, subType, this.boundingMap, iconTextures, options);
3328
+ var mesh = this.mesh = createMeshFromSubType(engine, subType, this.boundingMap, iconTextures, options);
3328
3329
  this.targetItem = item;
3329
3330
  meshesToAdd.push(mesh);
3330
3331
  };
@@ -3406,6 +3407,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3406
3407
  var _proto = EditorGizmoPlugin.prototype;
3407
3408
  _proto.onCompositionConstructed = function onCompositionConstructed(composition, scene) {
3408
3409
  var engine = composition.renderer.engine;
3410
+ iconTextures.clear();
3409
3411
  iconImages.forEach(function(image, name) {
3410
3412
  iconTextures.set(name, createTexture(engine, image));
3411
3413
  });
@@ -3493,7 +3495,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3493
3495
  };
3494
3496
  _proto.removeGizmoItem = function removeGizmoItem(composition, gizmoVFXItem) {
3495
3497
  var _this = this;
3496
- var gizmoMesh = gizmoVFXItem.content;
3498
+ var gizmoMesh = gizmoVFXItem.getComponent(GizmoComponent).mesh;
3497
3499
  if (gizmoMesh && !gizmoMesh.isDestroyed) {
3498
3500
  gizmoMesh.dispose();
3499
3501
  if (gizmoMesh.name === GeometryType.FloorGrid.toString() || gizmoMesh.name === "Box") {
@@ -3648,16 +3650,13 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3648
3650
  });
3649
3651
  })();
3650
3652
  };
3651
- EditorGizmoPlugin.onPlayerDestroy = function onPlayerDestroy() {
3652
- iconTextures.clear();
3653
- };
3654
3653
  return EditorGizmoPlugin;
3655
3654
  }(AbstractPlugin);
3656
3655
 
3657
3656
  registerPlugin("editor-gizmo", EditorGizmoPlugin, VFXItem);
3658
3657
  /**
3659
3658
  * 插件版本号
3660
- */ var version = "2.7.0-alpha.2";
3659
+ */ var version = "2.7.0";
3661
3660
  logger.info("Plugin editor gizmo version: " + version + ".");
3662
3661
  if (version !== EFFECTS.version) {
3663
3662
  console.error("注意:请统一 Editor Gizmo 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Editor Gizmo plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");