79b16f3e01
Implement request from https://github.com/armory3d/armory/issues/1155
24 lines
449 B
Haxe
24 lines
449 B
Haxe
package armory.logicnode;
|
|
|
|
import iron.object.Object;
|
|
|
|
class GetPropertyNode extends LogicNode {
|
|
|
|
public function new(tree:LogicTree) {
|
|
super(tree);
|
|
}
|
|
|
|
override function get(from:Int):Dynamic {
|
|
var object:Object = inputs[0].get();
|
|
var property:String = inputs[1].get();
|
|
|
|
if (from == 0) {
|
|
if (object == null || object.properties == null) return null;
|
|
return object.properties.get(property);
|
|
}
|
|
else {
|
|
return property;
|
|
}
|
|
}
|
|
}
|