まずこれは行ける。
var ordinals = new string[] { "First", "Second", "Third" }; var indexed = ordinals.Select((n, i) => new { Index = i, Ordinal = n }) .Select((e) => { Debug.Log(e.Index); Debug.Log(e.Ordinal); return e; }).ToArray();
"First" 0 "Second" 1 "Third" 2
これも行ける。
var indexed = ordinals .Select((e, i) => { Debug.Log(e); Debug.Log(i); return e; }).ToArray();
"First" 0 "Second" 1 "Third" 2