armory/Sources/armory/logicnode/SetHaxePropertyNode.hx

21 lines
394 B
Haxe
Raw Normal View History

2017-05-06 00:22:15 +02:00
package armory.logicnode;
class SetHaxePropertyNode extends LogicNode {
2017-05-06 00:22:15 +02:00
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2017-05-06 00:22:15 +02:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function run(from: Int) {
var object: Dynamic = inputs[1].get();
var property: String = inputs[2].get();
var value: Dynamic = inputs[3].get();
2017-09-20 14:27:45 +02:00
if (object == null) return;
2017-05-06 00:22:15 +02:00
Reflect.setProperty(object, property, value);
2018-10-22 10:10:33 +02:00
runOutput(0);
2017-05-06 00:22:15 +02:00
}
}