The ForEachLoop node repeats Body node for each element in an array or an object collection.
Examples
Flow Graph:
Generated Script:
using UnityEngine; using System.Collections; using System.Collections.Generic; public class test : MonoBehaviour { public void Start() { int[] array = new int[] { 1, 2, 4, 8, 16 }; foreach(int loopObject in array) { Debug.Log(loopObject); } } }
Output:
1 2 4 8 16