ProtoFlux:ForEach
More actions
The ForEach node takes in a Collection and if the node should be done in reverse or not. When called, it will iterate through the collection, providing each element in the collection on the Element output during each iteration. For dictionaries, order of elements provided is not guaranteed, so treat each iteration as independent of any other. For lists or arrays, the order starts from index 0 and ends with the last index, or in reverse order if Reverse is true.
It directly calls the C# foreach function.
It has an async version too, see: AsyncForEach.
Inputs
* (Call)
Calls an impulse to loop through a collection.
Collection (ICollection)
The collection to loop through.
Reverse (Bool)
Makes the loop go in reverse when iterating.
Outputs
LoopStart (Call)
Fires when the loop is about to start.
LoopIteration (Call)
Fires when the loop iterating through each element of the collection list.
LoopFailed (Continuation)
Fires when the loop failed. For example, this is triggered when when the collection being iterating through is modified. [1]
LoopEnd (Continuation)
Fires when the loop has ended.
Element (Generic)
The element of the collection currently being iterated through. If the collection being iterated through is a dictionary, this output will be a KeyValuePair matching the key and value types of the dictionary. The UnpackKeyValuePair node must be used to see the underlying data in this case.