forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
29
leenkx/Sources/leenkx/logicnode/ArrayVectorNode.hx
Normal file
29
leenkx/Sources/leenkx/logicnode/ArrayVectorNode.hx
Normal file
@ -0,0 +1,29 @@
|
||||
package leenkx.logicnode;
|
||||
|
||||
import iron.math.Vec4;
|
||||
|
||||
class ArrayVectorNode extends LogicNode {
|
||||
|
||||
public var value: Array<Vec4> = [];
|
||||
var initialized = false;
|
||||
|
||||
public function new(tree: LogicTree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
override function get(from: Int): Dynamic {
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
for (inp in inputs) {
|
||||
var val: Vec4 = inp.get();
|
||||
value.push(val);
|
||||
}
|
||||
}
|
||||
|
||||
return from == 0 ? value : value.length;
|
||||
}
|
||||
|
||||
override function set(value: Dynamic) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user