// Use this for initialization void Start() { GameObject[] objs = (GameObject[])FindObjectsOfType(typeof(GameObject)); foreach (GameObject gObj in objs) { Island island = gObj.GetComponent <Island> (); if (island != null) { if (player.Levels.ContainsKey(island.LevelName)) { island.Completed = true; } } } foreach (Island island in islands) { island.CheckRequirements(); } }