public static void SaveTo3x4PNG(this Cubemap cubemap, string path) { Texture2D texture2D = cubemap.Get3x4Texture2D(); texture2D.SaveToPNG(path); if (Application.isPlaying) { GameObject.Destroy(texture2D); } else { GameObject.DestroyImmediate(texture2D); } }