public void Clear() { sounds.Clear(); if (sky != null) { sky.Clear(); } world = null; water = null; models = null; sky = null; //destroy map if (mapParent != null) { UnityEngine.Object.Destroy(mapParent); mapParent = null; } //destroy textures var ob = UnityEngine.Object.FindObjectsOfType(typeof(Texture2D)); int dCount = 0; foreach (Texture2D t in ob) { if (t.name.StartsWith("maptexture@")) { dCount++; UnityEngine.Object.Destroy(t); } } Debug.Log(dCount + " textures destroyed"); worldCompleted = altitudeCompleted = groundCompleted = modelsCompleted = false; }