lythreeframe 1.1.0 → 1.1.1

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.
@@ -3031,8 +3031,8 @@ class TransformGizmo extends Pawn {
3031
3031
  this.onDraggingChangedEvent = (param) => { this.onDraggingChanged(param); };
3032
3032
  this.onObjectChangeEvent = () => { this.onObjectChanged(); };
3033
3033
  this.onChangeEvent = () => { this.onChange(); };
3034
- this.onUpdateFunctions = [];
3035
- this.onDraggingFunctions = [];
3034
+ this.onUpdateFunction = null;
3035
+ this.onDraggingFunction = null;
3036
3036
  let canvas = controller.viewPort.canvas;
3037
3037
  if (!canvas) {
3038
3038
  throw new Error("TransformGizmo:Canvas not found");
@@ -3086,9 +3086,9 @@ class TransformGizmo extends Pawn {
3086
3086
  let tMatrix = this.primaryTarget.getMatrixInWorld();
3087
3087
  tMatrix.decompose(this.helperObject.position, this.helperObject.quaternion, this.helperObject.scale);
3088
3088
  }
3089
- this.onDraggingFunctions.forEach((elem) => {
3090
- elem(event.value);
3091
- });
3089
+ if (this.onDraggingFunction) {
3090
+ this.onDraggingFunction(event.value);
3091
+ }
3092
3092
  }
3093
3093
  onObjectChanged() {
3094
3094
  if (this.primaryTarget) {
@@ -3108,9 +3108,9 @@ class TransformGizmo extends Pawn {
3108
3108
  }
3109
3109
  });
3110
3110
  }
3111
- this.onUpdateFunctions.forEach((elem) => {
3112
- elem();
3113
- });
3111
+ if (this.onUpdateFunction) {
3112
+ this.onUpdateFunction();
3113
+ }
3114
3114
  }
3115
3115
  set enable(newEnable) {
3116
3116
  this.control.enabled = newEnable;
@@ -3130,13 +3130,10 @@ class TransformGizmo extends Pawn {
3130
3130
  this.targetMatrixMap.set(elem, TB_local);
3131
3131
  });
3132
3132
  if (onUpdate) {
3133
- this.onUpdateFunctions.push(onUpdate);
3134
- }
3135
- if (onUpdate) {
3136
- this.onUpdateFunctions.push(onUpdate);
3133
+ this.onUpdateFunction = onUpdate;
3137
3134
  }
3138
3135
  if (onDragging) {
3139
- this.onDraggingFunctions.push(onDragging);
3136
+ this.onDraggingFunction = onDragging;
3140
3137
  }
3141
3138
  this.isTickEnabled = true;
3142
3139
  }
@@ -3182,8 +3179,8 @@ class TransformGizmo extends Pawn {
3182
3179
  this.targetMatrixMap.clear();
3183
3180
  this.targets = [];
3184
3181
  this.primaryTarget = null;
3185
- this.onUpdateFunctions = [];
3186
- this.onDraggingFunctions = [];
3182
+ this.onUpdateFunction = null;
3183
+ this.onDraggingFunction = null;
3187
3184
  (_a = this._control) === null || _a === void 0 ? void 0 : _a.dispose();
3188
3185
  this._control = null;
3189
3186
  super.destroy();
@@ -3029,8 +3029,8 @@ class TransformGizmo extends Pawn {
3029
3029
  this.onDraggingChangedEvent = (param) => { this.onDraggingChanged(param); };
3030
3030
  this.onObjectChangeEvent = () => { this.onObjectChanged(); };
3031
3031
  this.onChangeEvent = () => { this.onChange(); };
3032
- this.onUpdateFunctions = [];
3033
- this.onDraggingFunctions = [];
3032
+ this.onUpdateFunction = null;
3033
+ this.onDraggingFunction = null;
3034
3034
  let canvas = controller.viewPort.canvas;
3035
3035
  if (!canvas) {
3036
3036
  throw new Error("TransformGizmo:Canvas not found");
@@ -3084,9 +3084,9 @@ class TransformGizmo extends Pawn {
3084
3084
  let tMatrix = this.primaryTarget.getMatrixInWorld();
3085
3085
  tMatrix.decompose(this.helperObject.position, this.helperObject.quaternion, this.helperObject.scale);
3086
3086
  }
3087
- this.onDraggingFunctions.forEach((elem) => {
3088
- elem(event.value);
3089
- });
3087
+ if (this.onDraggingFunction) {
3088
+ this.onDraggingFunction(event.value);
3089
+ }
3090
3090
  }
3091
3091
  onObjectChanged() {
3092
3092
  if (this.primaryTarget) {
@@ -3106,9 +3106,9 @@ class TransformGizmo extends Pawn {
3106
3106
  }
3107
3107
  });
3108
3108
  }
3109
- this.onUpdateFunctions.forEach((elem) => {
3110
- elem();
3111
- });
3109
+ if (this.onUpdateFunction) {
3110
+ this.onUpdateFunction();
3111
+ }
3112
3112
  }
3113
3113
  set enable(newEnable) {
3114
3114
  this.control.enabled = newEnable;
@@ -3128,13 +3128,10 @@ class TransformGizmo extends Pawn {
3128
3128
  this.targetMatrixMap.set(elem, TB_local);
3129
3129
  });
3130
3130
  if (onUpdate) {
3131
- this.onUpdateFunctions.push(onUpdate);
3132
- }
3133
- if (onUpdate) {
3134
- this.onUpdateFunctions.push(onUpdate);
3131
+ this.onUpdateFunction = onUpdate;
3135
3132
  }
3136
3133
  if (onDragging) {
3137
- this.onDraggingFunctions.push(onDragging);
3134
+ this.onDraggingFunction = onDragging;
3138
3135
  }
3139
3136
  this.isTickEnabled = true;
3140
3137
  }
@@ -3180,8 +3177,8 @@ class TransformGizmo extends Pawn {
3180
3177
  this.targetMatrixMap.clear();
3181
3178
  this.targets = [];
3182
3179
  this.primaryTarget = null;
3183
- this.onUpdateFunctions = [];
3184
- this.onDraggingFunctions = [];
3180
+ this.onUpdateFunction = null;
3181
+ this.onDraggingFunction = null;
3185
3182
  (_a = this._control) === null || _a === void 0 ? void 0 : _a.dispose();
3186
3183
  this._control = null;
3187
3184
  super.destroy();
@@ -25,8 +25,8 @@ export declare class TransformGizmo extends Pawn {
25
25
  }) => void;
26
26
  protected onObjectChangeEvent: () => void;
27
27
  protected onChangeEvent: () => void;
28
- protected onUpdateFunctions: (() => void)[];
29
- protected onDraggingFunctions: ((event: any) => void)[];
28
+ protected onUpdateFunction: (() => void) | null;
29
+ protected onDraggingFunction: ((event: any) => void) | null;
30
30
  constructor(controller: Controller);
31
31
  possess(): void;
32
32
  unpossess(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",