BasicScriptNode
APJS Script API reference for the BasicScriptNode class.
| Type | Name | Interface Description |
|---|---|---|
| Variables | scene: APJS.Scene | • Function: The scene provided by the visual scripting runtime for this node execution context. This value comes from the graph runtime and is available when the node is executing. Use it inside |
| Functions | execute(): void | • Function: Main execution entry for the node. The visual scripting system calls this method when the node is triggered. Override it in custom nodes to read inputs, update outputs, access |
Examples
scene: APJS.Scene
@customNode()
export class FindNode extends BasicScriptNode {
execute(): void {
const target = this.scene.findSceneObject('Target');
if (target) {
console.log(target.name);
}
}
}
execute(): void
@customNode()
export class PrintNode extends BasicScriptNode {
execute(): void {
const target = this.scene.findSceneObject('Target');
if (target) {
console.log(target.name);
}
}
}
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use BasicScriptNode here
}
onUpdate(deltaTime: number) {
}
}