using UnityEngine;
using System.Collections.Generic;
public class TestForEach : MonoBehaviour
{
private List<int> list = new List<int> {1, 2, 3};
private int count;
private void Update()
{
list.ForEach(i => count += i);
}
}