ScriptBase

new ScriptBase(context, object3D, variables)

Skeleton of a game context script, different Context.EVENT are trigger by Context

Parameters:
NameTypeDescription
contextContext

context of this script

object3DObject3D

object3D bind (attach) to this script

variablesobject

custom variables bind (attach) to this script

Members

context :Context

context of this script

Type:

object3D :Object3D

object3D attach to this script

variables :object

custom variables attach to this script

Type:
  • object

(static) DEFAULT_VARIABLES

Methods

applyCommandCallbackOf(type, callback)

Parameters:
NameTypeDescription
typestring

type of command treated

callbackCommandCallback

callback to apply to command

init()

call after object3D load and register in collision system

isColliding(object3D)

call if object3D is not static and is colliding a static object3D (object3D must have Collider)

Parameters:
NameTypeDescription
object3DObject3D

object3D collided

load() → {Promise}

call after object3D controllers initialized

Returns:
  • 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)

Parameters:
NameTypeDescription
object3DObject3D

object3D collided

onLeaveCollision(object3D)

call if object3D is not static and was colliding a static object3D (object3D must have Collider)

Parameters:
NameTypeDescription
object3DObject3D

object3D collided leaving

tick()

call every step