new ScriptBase(context, object3D, variables)
Skeleton of a game context script, different Context.EVENT
are trigger by Context
Name | Type | Description |
---|---|---|
context | Context | context of this script |
object3D | Object3D | object3D bind (attach) to this script |
variables | object | custom variables bind (attach) to this script |
- Source
Members
context :Context
context of this script
- Source
object3D :Object3D
object3D attach to this script
- Source
variables :object
custom variables attach to this script
- object
- Source
(static) DEFAULT_VARIABLES
- Source
Methods
applyCommandCallbackOf(type, callback)
Name | Type | Description |
---|---|---|
type | string | type of command treated |
callback | CommandCallback | callback to apply to command |
- Source
init()
call after object3D load and register in collision system
- Source
isColliding(object3D)
call if object3D is not static and is colliding a static object3D (object3D must have Collider
)
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D collided |
- Source
load() → {Promise}
call after object3D controllers initialized
- Source
- promise when object3D has loaded
- Type:
- Promise
onEnterCollision(object3D)
call if object3D is not static and first collide a static object3D (object3D must have Collider
)
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D collided |
- Source
onLeaveCollision(object3D)
call if object3D is not static and was colliding a static object3D (object3D must have Collider
)
Name | Type | Description |
---|---|---|
object3D | Object3D | object3D collided leaving |
- Source
tick()
call every step
- Source