Add Index output for array iterator loop
This commit is contained in:
@@ -327,7 +327,8 @@ namespace FlaxEditor.Surface.Archetypes
|
||||
NodeElementArchetype.Factory.Input(2, "Break", false, typeof(void), 2),
|
||||
NodeElementArchetype.Factory.Output(0, "Loop", typeof(void), 3, true),
|
||||
NodeElementArchetype.Factory.Output(1, "Item", typeof(object), 4),
|
||||
NodeElementArchetype.Factory.Output(2, "Done", typeof(void), 5, true),
|
||||
NodeElementArchetype.Factory.Output(2, "Index", typeof(int), 5),
|
||||
NodeElementArchetype.Factory.Output(3, "Done", typeof(void), 6, true),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1164,7 +1164,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
if (boxBase->HasConnection())
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
}
|
||||
boxBase = node->GetBox(5);
|
||||
boxBase = node->GetBox(6);
|
||||
if (boxBase->HasConnection())
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
break;
|
||||
@@ -1180,6 +1180,11 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
if (iteratorIndex != scope->ReturnedValues.Count() && arrayIndex != scope->ReturnedValues.Count())
|
||||
value = scope->ReturnedValues[arrayIndex].Value.AsArray()[(int32)scope->ReturnedValues[iteratorIndex].Value];
|
||||
break;
|
||||
// Index
|
||||
case 5:
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
value = (int32)scope->ReturnedValues[iteratorIndex].Value;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user