armory/Sources/armory/logicnode/ArraySpliceNode.hx

21 lines
354 B
Haxe
Raw Permalink Normal View History

2018-06-24 15:47:39 +02:00
package armory.logicnode;
class ArraySpliceNode extends LogicNode {
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2018-06-24 15:47:39 +02:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function run(from: Int) {
var ar: Array<Dynamic> = inputs[1].get();
2018-06-24 15:47:39 +02:00
if (ar == null) return;
var i = inputs[2].get();
var len = inputs[3].get();
ar.splice(i, len);
2018-10-22 10:10:33 +02:00
runOutput(0);
2018-06-24 15:47:39 +02:00
}
}