Skip to content

Commit

Permalink
Update component-object-reference.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
marwie authored Mar 5, 2025
1 parent 5bcacfd commit 8001d7d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Behaviour, serializable } from "@needle-tools/engine";
import { Behaviour, serializable, Camera } from "@needle-tools/engine";
import { Object3D } from "three"

export class MyClass extends Behaviour {
Expand All @@ -10,4 +10,8 @@ export class MyClass extends Behaviour {
// Note that the @serializable decorator contains the array content type! (Object3D and not Object3D[])
@serializable(Object3D)
myObjectReferenceList: Object3D[] | null = null;
}

// for component or other objects use the object's type
@serializable(Camera)
myCameraComponent: Camera | null = null;
}

0 comments on commit 8001d7d

Please sign in to comment.