armory/Sources/armory/logicnode/GetNameNode.hx

19 lines
300 B
Haxe
Raw Normal View History

2017-04-04 23:11:31 +02:00
package armory.logicnode;
2017-11-20 15:16:52 +01:00
import iron.object.Object;
2017-04-04 23:11:31 +02:00
2017-04-08 20:05:35 +02:00
class GetNameNode extends LogicNode {
2017-04-04 23:11:31 +02:00
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2017-04-04 23:11:31 +02:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function get(from: Int): Dynamic {
var object: Object = inputs[0].get();
2017-04-04 23:11:31 +02:00
2019-12-19 23:54:08 +01:00
if (object == null) return "";
2017-04-08 00:34:45 +02:00
2017-04-04 23:11:31 +02:00
return object.name;
}
}