Skip to content

Commit 33afca4

Browse files
authored
feat(docs): add scriptName static property to various scripts in examples and components (#244)
1 parent c06f068 commit 33afca4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

packages/docs/components/MotionEntity.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export const MotionLight: FC<MotionLightProps> = ({ intensity = 1, type = "direc
101101
}, [intensity]);
102102

103103
class LightScript extends PcScript {
104+
static scriptName = 'lightScript';
104105
update() {
105106
this.entity.light.intensity = intensityMV.get();
106107
}

packages/docs/content/examples/motion.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const MouseRotation = () => {
1010
* and then uses an imperative script to update the rotation of the entity.
1111
*/
1212
class MouseRotatesEntity extends pc.Script {
13+
static scriptName = 'mouseRotatesEntity';
1314
initialize() {
1415
this.t = new pc.Vec2()
1516
this.c = new pc.Vec2()

packages/docs/content/examples/physics.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const Physics = () => {
2525
const swirl = new pc.Vec3();
2626

2727
class MoverScript extends pc.Script {
28+
static scriptName = 'mover';
29+
2830
update(dt) {
2931
const delta = Math.min(0.1, dt)
3032

@@ -49,6 +51,8 @@ export const Physics = () => {
4951

5052
// Follows the mouse cursor
5153
class FollowPointerScript extends pc.Script {
54+
static scriptName = 'followPointer';
55+
5256
pointer = new pc.Vec3();
5357

5458
initialize() {

0 commit comments

Comments
 (0)