armory/Sources/armory/logicnode/ColorNode.hx
2019-12-19 23:54:08 +01:00

25 lines
469 B
Haxe

package armory.logicnode;
import iron.math.Vec4;
class ColorNode extends LogicNode {
var value = new Vec4();
public function new(tree: LogicTree, r = 0.8, g = 0.8, b = 0.8, a = 1.0) {
super(tree);
value.set(r, g, b, a);
}
override function get(from: Int): Dynamic {
if (inputs.length > 0) return inputs[0].get();
return value;
}
override function set(value: Dynamic) {
if (inputs.length > 0) inputs[0].set(value);
else this.value = value;
}
}