armory/Sources/armory/logicnode/SetTraitPausedNode.hx

20 lines
411 B
Haxe
Raw Permalink Normal View History

2020-10-09 22:43:17 +02:00
package armory.logicnode;
class SetTraitPausedNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
var trait: Dynamic = inputs[1].get();
2020-10-09 22:46:46 +02:00
var paused: Bool = inputs[2].get();
2020-10-09 22:43:17 +02:00
if (trait == null || !Std.isOfType(trait, LogicTree)) return;
2020-10-09 22:43:17 +02:00
2020-10-14 15:03:47 +02:00
paused ? cast(trait, LogicTree).pause() : cast(trait, LogicTree).resume();
2020-10-09 22:43:17 +02:00
runOutput(0);
}
}