baobao
4/10/2017 - 2:15 PM

After.cs

// 展開後
using System;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{
	//
	// Methods
	//
	private void Start ()
	{
		List<int> list = new List<int> {
			1,
			2,
			3,
			4
		};
		foreach (int current in list) {
			Debug.Log (current);
		}
	}
}
// 展開前
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour {

    void Start (){
        var list = new List<int> (){ 1, 2, 3, 4 };
        foreach (var o in list)
            Debug.Log (o);
    }
}