new ScriptController(model, object3D, scripts)
Controller of object3D script component
Parameters:
Name | Type | Description |
---|---|---|
model | ScriptModel | model of this controller |
object3D | object | object3D parent of the script component TODO; cyclic reference why controller need to know their object3D ? |
scripts | Map.<string, object> | instances of scripts |
- Source
Members
scripts :Map.<string, object>
instances of scripts
Type:
- Map.<string, object>
- Source
Methods
execute(event, params)
Execute all scripts for a particular event
Parameters:
Name | Type | Description |
---|---|---|
event | string | event trigger (event should be a method of the script instances) |
params | Array | parameters pass to scripts |
- Source
executeScript(script, event, params) → {*}
Execute a script for a particular event
Parameters:
Name | Type | Description |
---|---|---|
script | object | instance of script (class) |
event | string | event trigger (event should be a method of the script instance) |
params | Array | parameters to pass to the script |
- Source
Returns:
- value return by the script (null if no event associated at ths script)
- Type:
- *
setVariables(variables)
Modify variables of the model + overwrite variables in scripts
Parameters:
Name | Type | Description |
---|---|---|
variables | object | new variables of this script controller |
- Source