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

22 lines
437 B
Haxe

package armory.logicnode;
import iron.object.LightObject;
class SetLightStrengthNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function run(from: Int) {
var light: LightObject = inputs[1].get();
var strength: Float = inputs[2].get();
if (light == null) return;
light.data.raw.strength = light.data.raw.type == "sun" ? strength * 0.325 : strength * 0.026;
runOutput(0);
}
}