armory/Sources/armory/logicnode/BooleanNode.hx
2017-04-14 20:38:50 +02:00

22 lines
417 B
Haxe

package armory.logicnode;
class BooleanNode extends LogicNode {
public var value:Bool;
public function new(tree:LogicTree, value = false) {
super(tree);
this.value = value;
}
override function get(from:Int):Dynamic {
if (inputs.length > 0) return inputs[0].get();
return value;
}
override function set(value:Dynamic) {
if (inputs.length > 0) inputs[0].set(value);
else this.value = value;
}
}