void Cleanup()
{
faces = null;
Destroy(copyCameraScript);
Destroy(cam);
if (camGos != null)
for (int i = camGos.Length - 1; i >= 0; i--)
if (camGos[i] != null)
Destroy(camGos[i]);
camGos = null;
numCameras = -1;
hFov = vFov = -1.0f;
if (cubemapRenderTexture != null)
Destroy(cubemapRenderTexture);
cubemapRenderTexture = null;
convertPanoramaKernelIdx = renderStereoIdx = textureToBufferIdx = -1;
convertPanoramaKernelIdxs = null;
resultPixels = cameraPixels = null;
if (forceWaitTexture != null)
Destroy(forceWaitTexture);
forceWaitTexture = new Texture2D(1, 1);
}