@galacean/effects-plugin-editor-gizmo 2.8.0-alpha.4 → 2.8.0-alpha.6

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.
@@ -1,7 +1,8 @@
1
- import type { Composition, Scene, Texture } from '@galacean/effects';
1
+ import type { Composition, Scene, SceneLoadOptions, Texture } from '@galacean/effects';
2
2
  import { Plugin } from '@galacean/effects';
3
3
  export declare const iconTextures: Map<string, Texture>;
4
4
  export declare class EditorGizmoPlugin extends Plugin {
5
5
  order: number;
6
- onCompositionCreated(composition: Composition, scene: Scene): Promise<void>;
6
+ onAssetsLoadStart(scene: Scene, options?: SceneLoadOptions | undefined): Promise<void>;
7
+ onCompositionCreated(composition: Composition, scene: Scene): void;
7
8
  }
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.8.0-alpha.4
6
+ * Version: v2.8.0-alpha.6
7
7
  */
8
8
 
9
9
  'use strict';
@@ -3660,13 +3660,12 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3660
3660
  return _this;
3661
3661
  }
3662
3662
  var _proto = EditorGizmoPlugin.prototype;
3663
- _proto.onCompositionCreated = function onCompositionCreated(composition, scene) {
3663
+ _proto.onAssetsLoadStart = function onAssetsLoadStart(scene, options) {
3664
3664
  return _async_to_generator(function() {
3665
- var engine, _iterator, _step, _step_value, name, data, _, _tmp, items, targetMap, i, item, gizmoComponent;
3665
+ var _iterator, _step, _step_value, name, data, _, _tmp;
3666
3666
  return __generator(this, function(_state) {
3667
3667
  switch(_state.label){
3668
3668
  case 0:
3669
- engine = composition.renderer.engine;
3670
3669
  iconTextures.clear();
3671
3670
  if (!(iconImages.size !== axisIconMap.size)) return [
3672
3671
  3,
@@ -3699,24 +3698,6 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3699
3698
  1
3700
3699
  ];
3701
3700
  case 4:
3702
- iconImages.forEach(function(image, name) {
3703
- iconTextures.set(name, createTexture(engine, image));
3704
- });
3705
- iconImages.clear();
3706
- items = composition.items;
3707
- targetMap = {};
3708
- for(i = 0; i < items.length; i++){
3709
- item = items[i];
3710
- gizmoComponent = item.getComponent(exports.GizmoComponent);
3711
- if (gizmoComponent) {
3712
- if (!targetMap[gizmoComponent.target]) {
3713
- targetMap[gizmoComponent.target] = [];
3714
- }
3715
- targetMap[gizmoComponent.target].push(item);
3716
- }
3717
- }
3718
- composition.loaderData.gizmoTarget = targetMap;
3719
- composition.loaderData.gizmoItems = [];
3720
3701
  return [
3721
3702
  2
3722
3703
  ];
@@ -3724,13 +3705,34 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3724
3705
  });
3725
3706
  })();
3726
3707
  };
3708
+ _proto.onCompositionCreated = function onCompositionCreated(composition, scene) {
3709
+ var engine = composition.renderer.engine;
3710
+ iconImages.forEach(function(image, name) {
3711
+ iconTextures.set(name, createTexture(engine, image));
3712
+ });
3713
+ iconImages.clear();
3714
+ var items = composition.items;
3715
+ var targetMap = {};
3716
+ for(var i = 0; i < items.length; i++){
3717
+ var item = items[i];
3718
+ var gizmoComponent = item.getComponent(exports.GizmoComponent);
3719
+ if (gizmoComponent) {
3720
+ if (!targetMap[gizmoComponent.target]) {
3721
+ targetMap[gizmoComponent.target] = [];
3722
+ }
3723
+ targetMap[gizmoComponent.target].push(item);
3724
+ }
3725
+ }
3726
+ composition.loaderData.gizmoTarget = targetMap;
3727
+ composition.loaderData.gizmoItems = [];
3728
+ };
3727
3729
  return EditorGizmoPlugin;
3728
3730
  }(_wrap_native_super(EFFECTS.Plugin));
3729
3731
 
3730
3732
  EFFECTS.registerPlugin("editor-gizmo", EditorGizmoPlugin);
3731
3733
  /**
3732
3734
  * 插件版本号
3733
- */ var version = "2.8.0-alpha.4";
3735
+ */ var version = "2.8.0-alpha.6";
3734
3736
  EFFECTS.logger.info("Plugin editor gizmo version: " + version + ".");
3735
3737
  if (version !== EFFECTS__namespace.version) {
3736
3738
  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!");