public void collectEgg(GameObject eg) { persistentDataScript.CollectEgg(); if (Eggs.Contains(eg)) { int index = Eggs.IndexOf(eg); collectedEggs[index] = 1; } }