armory/Sources/armory/logicnode/OnUpdateNode.hx
2019-01-23 13:23:05 +01:00

28 lines
570 B
Haxe

package armory.logicnode;
import armory.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 arm_physics
case "Physics Pre-Update": PhysicsWorld.active.notifyOnPreUpdate(update);
#end
default /* Update */: tree.notifyOnUpdate(update);
}
}
function update() {
runOutput(0);
}
}