armory/Sources/armory/logicnode/StringNode.hx

22 lines
420 B
Haxe
Raw Normal View History

2017-04-03 22:29:46 +02:00
package armory.logicnode;
2017-04-08 20:05:35 +02:00
class StringNode extends LogicNode {
2017-04-03 22:29:46 +02:00
2019-12-19 23:54:08 +01:00
public var value: String;
2017-04-03 22:29:46 +02:00
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree, value = "") {
2017-04-04 23:11:31 +02:00
super(tree);
2017-04-03 22:29:46 +02:00
this.value = value;
}
2019-12-19 23:54:08 +01:00
override function get(from: Int): Dynamic {
2017-04-03 22:29:46 +02:00
if (inputs.length > 0) return inputs[0].get();
return value;
}
2019-12-19 23:54:08 +01:00
override function set(value: Dynamic) {
2017-04-14 20:38:50 +02:00
if (inputs.length > 0) inputs[0].set(value);
else this.value = value;
2017-04-03 22:29:46 +02:00
}
}