static void Main(string[] args) { // Array of Structures var creatures = new Creature[100]; foreach (var c in creatures) { c.X++; } // AXY AXY AXY // Structure of Arrays var creatures2 = new Creatures(100); // performance improvement foreach (var c in creatures2) { c.X++; } // AAA XXX YYY }
public CreatureProxy(Creatures creatures, int index) { this.creatures = creatures; this.index = index; }