2023-09-14 16:29:39 +02:00
|
|
|
function Node_PCX_Condition(_x, _y, _group = noone) : Node_PCX(_x, _y, _group) constructor {
|
|
|
|
name = "Condition";
|
|
|
|
|
2024-08-20 10:15:53 +02:00
|
|
|
newInput(0, nodeValue("Condition", self, CONNECT_TYPE.input, VALUE_TYPE.PCXnode, noone));
|
2023-09-14 16:29:39 +02:00
|
|
|
|
2024-08-20 10:15:53 +02:00
|
|
|
newInput(1, nodeValue("True", self, CONNECT_TYPE.input, VALUE_TYPE.PCXnode, noone));
|
2023-09-14 16:29:39 +02:00
|
|
|
|
2024-08-20 10:15:53 +02:00
|
|
|
newInput(2, nodeValue("False", self, CONNECT_TYPE.input, VALUE_TYPE.PCXnode, noone));
|
2023-09-14 16:29:39 +02:00
|
|
|
|
2024-09-04 03:57:11 +02:00
|
|
|
newOutput(0, nodeValue_Output("PCX", self, VALUE_TYPE.PCXnode, noone));
|
2023-09-14 16:29:39 +02:00
|
|
|
|
|
|
|
static update = function() {
|
2023-10-02 08:57:44 +02:00
|
|
|
var _cond = getInputData(0);
|
|
|
|
var _true = getInputData(1);
|
|
|
|
var _fals = getInputData(2);
|
2023-09-14 16:29:39 +02:00
|
|
|
|
|
|
|
var _fn = new __funcIf();
|
|
|
|
_fn.condition = _cond;
|
|
|
|
_fn.if_true = _true;
|
|
|
|
_fn.if_false = _fals;
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
outputs[0].setValue(_fn);
|
2023-09-14 16:29:39 +02:00
|
|
|
}
|
|
|
|
}
|