lythreeframe 1.2.1 → 1.2.3

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.
@@ -628,11 +628,14 @@ class SceneComponent extends Component {
628
628
  }
629
629
  }
630
630
  destroyChildren() {
631
+ var _a;
631
632
  if (!this.threeObject) {
632
633
  return;
633
634
  }
634
635
  for (let i = 0; i < this.threeObject.children.length; ++i) {
635
- this.threeObject.children[i].userData.LYObject.destroy();
636
+ let obj = (_a = this.threeObject.children[i].userData) === null || _a === void 0 ? void 0 : _a.LYObject;
637
+ if (obj)
638
+ this.threeObject.children[i].userData.LYObject.destroy();
636
639
  }
637
640
  }
638
641
  /* horver */
@@ -3001,7 +3004,6 @@ class SkyComponent extends SceneComponent {
3001
3004
  }
3002
3005
  constructor(app, skyparam, uuid) {
3003
3006
  super(app, uuid);
3004
- this.obj = null;
3005
3007
  this.skyParam = DefaultSkyParam;
3006
3008
  this.sunPosition = new webgpu.Vector3();
3007
3009
  if (skyparam) {
@@ -3026,17 +3028,17 @@ class SkyComponent extends SceneComponent {
3026
3028
  }
3027
3029
  destroyObject() {
3028
3030
  if (this.obj) {
3029
- ThreeObjectLibrary.disposeMeshResource(this.obj);
3031
+ ThreeObjectLibrary.disposeMeshResource(this.threeObject);
3030
3032
  }
3031
3033
  }
3032
3034
  }
3033
3035
 
3034
3036
  class SkyActor extends Actor {
3035
- constructor(app) {
3036
- super(app);
3037
+ constructor(app, uuid) {
3038
+ super(app, uuid);
3037
3039
  this._name = "SkyActor";
3038
3040
  this.skyComponent = null;
3039
- this.name = "DirectionalLightActor";
3041
+ this.name = "SkyActor";
3040
3042
  this.skyComponent = this.rootComponent;
3041
3043
  this.rootComponent.name = `${this.rootComponent.name}(Root)`;
3042
3044
  this.setScale(45000, 45000, 45000);
@@ -626,11 +626,14 @@ class SceneComponent extends Component {
626
626
  }
627
627
  }
628
628
  destroyChildren() {
629
+ var _a;
629
630
  if (!this.threeObject) {
630
631
  return;
631
632
  }
632
633
  for (let i = 0; i < this.threeObject.children.length; ++i) {
633
- this.threeObject.children[i].userData.LYObject.destroy();
634
+ let obj = (_a = this.threeObject.children[i].userData) === null || _a === void 0 ? void 0 : _a.LYObject;
635
+ if (obj)
636
+ this.threeObject.children[i].userData.LYObject.destroy();
634
637
  }
635
638
  }
636
639
  /* horver */
@@ -2999,7 +3002,6 @@ class SkyComponent extends SceneComponent {
2999
3002
  }
3000
3003
  constructor(app, skyparam, uuid) {
3001
3004
  super(app, uuid);
3002
- this.obj = null;
3003
3005
  this.skyParam = DefaultSkyParam;
3004
3006
  this.sunPosition = new Vector3();
3005
3007
  if (skyparam) {
@@ -3024,17 +3026,17 @@ class SkyComponent extends SceneComponent {
3024
3026
  }
3025
3027
  destroyObject() {
3026
3028
  if (this.obj) {
3027
- ThreeObjectLibrary.disposeMeshResource(this.obj);
3029
+ ThreeObjectLibrary.disposeMeshResource(this.threeObject);
3028
3030
  }
3029
3031
  }
3030
3032
  }
3031
3033
 
3032
3034
  class SkyActor extends Actor {
3033
- constructor(app) {
3034
- super(app);
3035
+ constructor(app, uuid) {
3036
+ super(app, uuid);
3035
3037
  this._name = "SkyActor";
3036
3038
  this.skyComponent = null;
3037
- this.name = "DirectionalLightActor";
3039
+ this.name = "SkyActor";
3038
3040
  this.skyComponent = this.rootComponent;
3039
3041
  this.rootComponent.name = `${this.rootComponent.name}(Root)`;
3040
3042
  this.setScale(45000, 45000, 45000);
@@ -4,6 +4,6 @@ import { SkyComponent } from "../../Components/Sky/SkyComponent";
4
4
  export declare class SkyActor extends Actor {
5
5
  protected _name: string;
6
6
  protected skyComponent: SkyComponent | null;
7
- constructor(app: ThreeJsApp);
7
+ constructor(app: ThreeJsApp, uuid?: string);
8
8
  protected constructRootComponent(): SkyComponent;
9
9
  }
@@ -12,8 +12,7 @@ export interface SkyComponentParam {
12
12
  export declare const DefaultSkyParam: SkyComponentParam;
13
13
  export declare class SkyComponent extends SceneComponent {
14
14
  get threeObject(): SkyMesh;
15
- set threeObject(newThreeObject: SkyMesh);
16
- protected obj: SkyMesh | null;
15
+ protected set threeObject(newThreeObject: SkyMesh);
17
16
  private skyParam;
18
17
  private sunPosition;
19
18
  constructor(app: ThreeJsApp, skyparam?: SkyComponentParam, uuid?: string);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",