@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.32 → 2.0.0-alpha.34

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 player editor gizmo plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 茂安,旻诺
6
- * Version: v2.0.0-alpha.32
6
+ * Version: v2.0.0-alpha.34
7
7
  */
8
8
 
9
9
  'use strict';
@@ -326,7 +326,6 @@ function getQuadIndexData(faceCount, oid) {
326
326
  return indexData;
327
327
  }
328
328
  function createModeWireframe(engine, mesh, color) {
329
- var level = engine.gpuCapability.level;
330
329
  var geometry = new SharedGeometry(engine, {
331
330
  geometry: mesh.firstGeometry(),
332
331
  mode: EFFECTS.glContext.LINES,
@@ -344,8 +343,9 @@ function createModeWireframe(engine, mesh, color) {
344
343
  ];
345
344
  var _mesh_name;
346
345
  materialOptions.shader = {
347
- vertex: createGizmoShader(newMacros, vertex, EFFECTS.ShaderType.vertex, level),
348
- fragment: createGizmoShader(newMacros, fragment, EFFECTS.ShaderType.fragment, level),
346
+ vertex: vertex,
347
+ fragment: fragment,
348
+ macros: newMacros,
349
349
  shared: true,
350
350
  name: ((_mesh_name = mesh.name) != null ? _mesh_name : "unamedmesh") + "_wireframe",
351
351
  glslVersion: engine.gpuCapability.level === 2 ? EFFECTS.GLSLVersion.GLSL3 : EFFECTS.GLSLVersion.GLSL1
@@ -452,12 +452,6 @@ var SharedGeometry = /*#__PURE__*/ function(GLGeometry) {
452
452
  };
453
453
  return SharedGeometry;
454
454
  }(EFFECTS.GLGeometry);
455
- function createGizmoShader(macros, shader, shaderType, level) {
456
- var versionTag = /#version\s+\b\d{3}\b\s*(es)?/;
457
- var shaderMatch = shader.match(versionTag);
458
- var newShader = shaderMatch ? shader.substring(shaderMatch[0].length) : shader;
459
- return EFFECTS.createShaderWithMacros(macros, newShader, shaderType, level);
460
- }
461
455
 
462
456
  // 坐标轴默认颜色
463
457
  var color = {
@@ -3041,8 +3035,10 @@ exports.GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3041
3035
  }
3042
3036
  var _proto = GizmoComponent.prototype;
3043
3037
  _proto.start = function start() {
3038
+ var _this_item_composition;
3044
3039
  this.item.getHitTestParams = this.getHitTestParams;
3045
- for(var _iterator = _create_for_of_iterator_helper_loose(this.item.composition.items), _step; !(_step = _iterator()).done;){
3040
+ var _this_item_composition_items;
3041
+ for(var _iterator = _create_for_of_iterator_helper_loose((_this_item_composition_items = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.items) != null ? _this_item_composition_items : []), _step; !(_step = _iterator()).done;){
3046
3042
  var item = _step.value;
3047
3043
  if (item.id === this.target) {
3048
3044
  this.targetItem = item;
@@ -3053,7 +3049,8 @@ exports.GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3053
3049
  return;
3054
3050
  }
3055
3051
  var composition = this.item.composition;
3056
- for(var _iterator1 = _create_for_of_iterator_helper_loose(composition.pluginSystem.plugins), _step1; !(_step1 = _iterator1()).done;){
3052
+ var _composition_pluginSystem_plugins;
3053
+ for(var _iterator1 = _create_for_of_iterator_helper_loose((_composition_pluginSystem_plugins = composition == null ? void 0 : composition.pluginSystem.plugins) != null ? _composition_pluginSystem_plugins : []), _step1; !(_step1 = _iterator1()).done;){
3057
3054
  var plugin = _step1.value;
3058
3055
  if (plugin.name === "editor-gizmo") {
3059
3056
  this.gizmoPlugin = plugin;
@@ -3102,7 +3099,7 @@ exports.GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3102
3099
  this.createBoundingBoxContent(targetItem, gizmoPlugin.meshToAdd);
3103
3100
  break;
3104
3101
  }
3105
- composition.loaderData.gizmoItems.push(this.item);
3102
+ composition == null ? void 0 : composition.loaderData.gizmoItems.push(this.item);
3106
3103
  };
3107
3104
  _proto.update = function update(dt) {
3108
3105
  this.updateRenderData();
@@ -3716,7 +3713,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3716
3713
  }(EFFECTS.AbstractPlugin);
3717
3714
 
3718
3715
  EFFECTS.registerPlugin("editor-gizmo", EditorGizmoPlugin, EFFECTS.VFXItem);
3719
- var version = "2.0.0-alpha.32";
3716
+ var version = "2.0.0-alpha.34";
3720
3717
  EFFECTS.logger.info("Plugin editor gizmo version: " + version + ".");
3721
3718
  if (version !== EFFECTS__namespace.version) {
3722
3719
  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!");