Files
LNXSDK/leenkx/Sources/leenkx/logicnode/OnUpdateNode.hx
2025-01-22 16:18:30 +01:00

28 lines
572 B
Haxe

package leenkx.logicnode;
import leenkx.trait.physics.PhysicsWorld;
class OnUpdateNode extends LogicNode {
public var property0: String; // Update, Late Update, Physics Pre-Update
public function new(tree: LogicTree) {
super(tree);
tree.notifyOnInit(init);
}
function init() {
switch (property0) {
case "Late Update": tree.notifyOnLateUpdate(update);
#if lnx_physics
case "Physics Pre-Update": PhysicsWorld.active.notifyOnPreUpdate(update);
#end
default: tree.notifyOnUpdate(update); /* Update */
}
}
function update() {
runOutput(0);
}
}