Files
LNXSDK/leenkx/Sources/leenkx/logicnode/RandomChoiceNode.hx

15 lines
270 B
Haxe
Raw Normal View History

2025-01-22 16:18:30 +01:00
package leenkx.logicnode;
class RandomChoiceNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var array: Array<Dynamic> = inputs[0].get();
return array[Std.random(array.length)];
}
}