void CleanSceneCameras() { Camera[] sceneCameras = SceneView.GetAllSceneCameras(); for (int i = 0; i < sceneCameras.Length; i++) { PreviewCulling pc = sceneCameras[i].GetComponent <PreviewCulling>(); if (pc) { DestroyImmediate(pc); } } }
void CleanSceneCamera() { if (sceneCamera) { //remove the PreviewCulling script from the scene camera PreviewCulling pc = sceneCamera.GetComponent <PreviewCulling>(); if (pc) { DestroyImmediate(pc); } } }