@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.16 → 2.0.0-alpha.18

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,10 +3,11 @@
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.16
6
+ * Version: v2.0.0-alpha.18
7
7
  */
8
8
 
9
- import { math, DestroyOptions, glContext, ShaderType, GLSLVersion, Material, Mesh, GLGeometry, createShaderWithMarcos, Texture, noop, Geometry, Transform, effectsClass, ParticleSystemRenderer, RendererComponent, assertExist, ItemBehaviour, HitTestType, spec, removeItem, RenderPass, RenderPassPriorityPostprocess, TextureLoadAction, RenderPassPriorityPrepare, AbstractPlugin, registerPlugin, VFXItem, logger, version as version$1 } from '@galacean/effects';
9
+ import * as EFFECTS from '@galacean/effects';
10
+ import { math, DestroyOptions, glContext, ShaderType, GLSLVersion, Material, Mesh, GLGeometry, createShaderWithMacros, Texture, noop, Geometry, Transform, effectsClass, ParticleSystemRenderer, RendererComponent, assertExist, ItemBehaviour, HitTestType, spec, removeItem, RenderPass, RenderPassPriorityPostprocess, TextureLoadAction, RenderPassPriorityPrepare, AbstractPlugin, registerPlugin, VFXItem, logger } from '@galacean/effects';
10
11
 
11
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
12
13
  try {
@@ -306,9 +307,9 @@ function createModeWireframe(engine, mesh, color) {
306
307
  data: new Uint32Array(0)
307
308
  }
308
309
  });
309
- var _mesh_material_props_shader = mesh.material.props.shader, vertex = _mesh_material_props_shader.vertex, fragment = _mesh_material_props_shader.fragment, marcos = _mesh_material_props_shader.marcos;
310
+ var _mesh_material_props_shader = mesh.material.props.shader, vertex = _mesh_material_props_shader.vertex, fragment = _mesh_material_props_shader.fragment, macros = _mesh_material_props_shader.macros;
310
311
  var materialOptions = _extends({}, mesh.material.props);
311
- var newMarcos = [].concat(marcos || [], [
312
+ var newMacros = [].concat(macros || [], [
312
313
  [
313
314
  "PREVIEW_BORDER",
314
315
  1
@@ -316,8 +317,8 @@ function createModeWireframe(engine, mesh, color) {
316
317
  ]);
317
318
  var _mesh_name;
318
319
  materialOptions.shader = {
319
- vertex: createGizmoShader(newMarcos, vertex, ShaderType.vertex, level),
320
- fragment: createGizmoShader(newMarcos, fragment, ShaderType.fragment, level),
320
+ vertex: createGizmoShader(newMacros, vertex, ShaderType.vertex, level),
321
+ fragment: createGizmoShader(newMacros, fragment, ShaderType.fragment, level),
321
322
  shared: true,
322
323
  name: ((_mesh_name = mesh.name) != null ? _mesh_name : "unamedmesh") + "_wireframe",
323
324
  glslVersion: engine.gpuCapability.level === 2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1
@@ -424,11 +425,11 @@ var SharedGeometry = /*#__PURE__*/ function(GLGeometry) {
424
425
  };
425
426
  return SharedGeometry;
426
427
  }(GLGeometry);
427
- function createGizmoShader(marcos, shader, shaderType, level) {
428
+ function createGizmoShader(macros, shader, shaderType, level) {
428
429
  var versionTag = /#version\s+\b\d{3}\b\s*(es)?/;
429
430
  var shaderMatch = shader.match(versionTag);
430
431
  var newShader = shaderMatch ? shader.substring(shaderMatch[0].length) : shader;
431
- return createShaderWithMarcos(marcos, newShader, shaderType, level);
432
+ return createShaderWithMacros(macros, newShader, shaderType, level);
432
433
  }
433
434
 
434
435
  // 坐标轴默认颜色
@@ -3384,21 +3385,21 @@ var GizmoComponent = /*#__PURE__*/ function(ItemBehaviour) {
3384
3385
  ItemBehaviour.prototype.fromData.call(this, data);
3385
3386
  var item = this.item;
3386
3387
  item.duration = 999;
3387
- var opt = data.options;
3388
- this.target = opt.target;
3389
- this.subType = opt.subType;
3390
- this.renderMode = opt.renderMode || this.getDefaultRenderMode();
3391
- this.size = opt.size || this.getDefaultSize();
3392
- this.depthTest = opt.depthTest;
3393
- var c = opt.color || [
3388
+ var _data_options = data.options, target = _data_options.target, subType = _data_options.subType, renderMode = _data_options.renderMode, size = _data_options.size, depthTest = _data_options.depthTest, _data_options_color = _data_options.color, color = _data_options_color === void 0 ? [
3394
3389
  255,
3395
3390
  255,
3396
3391
  255
3397
- ];
3392
+ ] : _data_options_color;
3393
+ this.target = target;
3394
+ this.subType = subType;
3395
+ this.renderMode = renderMode || this.getDefaultRenderMode();
3396
+ this.size = size || this.getDefaultSize();
3397
+ this.depthTest = depthTest;
3398
+ var r = color[0], g = color[1], b = color[2];
3398
3399
  this.color = [
3399
- c[0] / 255,
3400
- c[1] / 255,
3401
- c[2] / 255
3400
+ r / 255,
3401
+ g / 255,
3402
+ b / 255
3402
3403
  ];
3403
3404
  if (data) {
3404
3405
  item.transform = new Transform(data.transform);
@@ -3677,9 +3678,9 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(AbstractPlugin) {
3677
3678
  }(AbstractPlugin);
3678
3679
 
3679
3680
  registerPlugin("editor-gizmo", EditorGizmoPlugin, VFXItem);
3680
- var version = "2.0.0-alpha.16";
3681
- logger.info("plugin editor gizmo version: " + version);
3682
- if (version !== version$1) {
3681
+ var version = "2.0.0-alpha.18";
3682
+ logger.info("Plugin editor gizmo version: " + version + ".");
3683
+ if (version !== EFFECTS.version) {
3683
3684
  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!");
3684
3685
  }
3685
3686