Skip to content

Commit a3cbe41

Browse files
authored
Tweak Script class API docs (#7501)
1 parent 7fc1e8c commit a3cbe41

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/framework/script/script.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import { SCRIPT_INITIALIZE, SCRIPT_POST_INITIALIZE } from './constants.js';
1515
* At its core, a script is simply a collection of methods that are called at various points in the
1616
* Engine's lifecycle. These methods are:
1717
*
18-
* {@link Script#initialize} - Called once when the script is initialized
19-
* {@link Script#postInitialize} - Called once after all scripts have been initialized
20-
* {@link Script#update} - Called every frame, if the script is enabled
21-
* {@link Script#postUpdate} - Called every frame, after all scripts have been updated
22-
* {@link Script#swap} - Called when a script is redefined
18+
* - `Script#initialize` - Called once when the script is initialized.
19+
* - `Script#postInitialize` - Called once after all scripts have been initialized.
20+
* - `Script#update` - Called every frame, if the script is enabled.
21+
* - `Script#postUpdate` - Called every frame, after all scripts have been updated.
22+
* - `Script#swap` - Called when a script is redefined.
2323
*
2424
* These methods are entirely optional, but provide a useful way to manage the lifecycle of a
2525
* script and perform any necessary setup and cleanup.
@@ -28,7 +28,7 @@ import { SCRIPT_INITIALIZE, SCRIPT_POST_INITIALIZE } from './constants.js';
2828
* @example
2929
* ```javascript
3030
* class EntityRotator extends Script {
31-
* update() {
31+
* update(dt) {
3232
* this.entity.rotateLocal(0, 1, 0);
3333
* }
3434
* }
@@ -153,14 +153,14 @@ export class Script extends EventHandler {
153153
static EVENT_ERROR = 'error';
154154

155155
/**
156-
* The {@link AppBase} that the instance of this type belongs to.
156+
* The {@link AppBase} that the instance of this script belongs to.
157157
*
158158
* @type {AppBase}
159159
*/
160160
app;
161161

162162
/**
163-
* The {@link Entity} that the instance of this type belongs to.
163+
* The {@link Entity} that the instance of this script belongs to.
164164
*
165165
* @type {Entity}
166166
*/
@@ -206,11 +206,11 @@ export class Script extends EventHandler {
206206
}
207207

208208
/**
209-
* True if the instance of this type is in running state. False when script is not running,
209+
* True if the instance of this script is in running state. False when script is not running,
210210
* because the Entity or any of its parents are disabled or the {@link ScriptComponent} is
211-
* disabled or the Script Instance is disabled. When disabled no update methods will be called
212-
* on each tick. initialize and postInitialize methods will run once when the script instance
213-
* is in `enabled` state during app tick.
211+
* disabled or the Script Instance is disabled. When disabled, no update methods will be called
212+
* on each tick. `initialize` and `postInitialize` methods will run once when the script
213+
* instance is in the `enabled` state during an app tick.
214214
*
215215
* @type {boolean}
216216
*/

0 commit comments

Comments
 (0)