Files
armorpaint/Sources/arm/brushnode/ObjectNode.hx
T

29 lines
647 B
Haxe
Raw Normal View History

2018-10-11 17:55:05 +02:00
package arm.brushnode;
2017-12-14 11:12:51 +01:00
2018-09-11 10:13:38 +02:00
import iron.object.Object;
2017-12-14 11:12:51 +01:00
import armory.logicnode.LogicNode;
import armory.logicnode.LogicTree;
2018-06-20 19:23:49 +02:00
@:keep
2017-12-14 11:12:51 +01:00
class ObjectNode extends LogicNode {
public var objectName:String;
public var value:Object;
public function new(tree:LogicTree, objectName:String = "") {
this.objectName = objectName;
super(tree);
}
override function get(from:Int):Dynamic {
if (inputs.length > 0) return inputs[0].get();
2018-08-09 22:51:15 +02:00
value = objectName != "" ? iron.Scene.active.getChild(objectName) : null;
2017-12-14 11:12:51 +01:00
return value;
}
override function set(value:Dynamic) {
if (inputs.length > 0) inputs[0].set(value);
else this.value = value;
}
}