using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestC : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        List<Func<int>> funcs = new List<Func<int>>();
        for (int i = 0; i < 3; i++)
        {
            int j = i;
            funcs.Add(() => { return j; });
        }
        foreach (var item in funcs)
        {
            Debug.LogError(item().ToString());
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
