@@ -28,6 +28,8 @@ import { SCRIPT_INITIALIZE, SCRIPT_POST_INITIALIZE } from './constants.js';
28
28
* @example
29
29
* ```javascript
30
30
* class EntityRotator extends Script {
31
+ * static scriptName = 'entityRotator';
32
+ *
31
33
* update(dt) {
32
34
* this.entity.rotateLocal(0, 1, 0);
33
35
* }
@@ -48,6 +50,7 @@ export class Script extends EventHandler {
48
50
* @event
49
51
* @example
50
52
* export class PlayerController extends Script {
53
+ * static scriptName = 'playerController';
51
54
* initialize() {
52
55
* this.on('enable', () => {
53
56
* // Script Instance is now enabled
@@ -63,6 +66,7 @@ export class Script extends EventHandler {
63
66
* @event
64
67
* @example
65
68
* export class PlayerController extends Script {
69
+ * static scriptName = 'playerController';
66
70
* initialize() {
67
71
* this.on('disable', () => {
68
72
* // Script Instance is now disabled
@@ -79,6 +83,7 @@ export class Script extends EventHandler {
79
83
* @event
80
84
* @example
81
85
* export class PlayerController extends Script {
86
+ * static scriptName = 'playerController';
82
87
* initialize() {
83
88
* this.on('state', (enabled) => {
84
89
* console.log(`Script Instance is now ${enabled ? 'enabled' : 'disabled'}`);
@@ -94,6 +99,7 @@ export class Script extends EventHandler {
94
99
* @event
95
100
* @example
96
101
* export class PlayerController extends Script {
102
+ * static scriptName = 'playerController';
97
103
* initialize() {
98
104
* this.on('destroy', () => {
99
105
* // no longer part of the entity
@@ -117,6 +123,7 @@ export class Script extends EventHandler {
117
123
* @event
118
124
* @example
119
125
* export class PlayerController extends Script {
126
+ * static scriptName = 'playerController';
120
127
* initialize() {
121
128
* this.on('attr', (name, newValue, oldValue) => {
122
129
* console.log(`Attribute '${name}' changed from '${oldValue}' to '${newValue}'`);
@@ -125,6 +132,7 @@ export class Script extends EventHandler {
125
132
* };
126
133
* @example
127
134
* export class PlayerController extends Script {
135
+ * static scriptName = 'playerController';
128
136
* initialize() {
129
137
* this.on('attr:speed', (newValue, oldValue) => {
130
138
* console.log(`Attribute 'speed' changed from '${oldValue}' to '${newValue}'`);
@@ -142,6 +150,7 @@ export class Script extends EventHandler {
142
150
* @event
143
151
* @example
144
152
* export class PlayerController extends Script {
153
+ * static scriptName = 'playerController';
145
154
* initialize() {
146
155
* this.on('error', (err, method) => {
147
156
* // caught an exception
0 commit comments