public static void FastSaveToSphericalPNG(this Cubemap cubemap, string path) { int w = cubemap.width * 2; int h = cubemap.height * 2; Texture2D sphericalMapping = TextureGenerator.SphericalMapping(w, h); cubemap.SaveToPNGWithDirectionalMapping(path, sphericalMapping); if (Application.isPlaying) { GameObject.Destroy(sphericalMapping); } else { GameObject.DestroyImmediate(sphericalMapping); } }