Skip to content

Instantly share code, notes, and snippets.

@shalperin
Created July 17, 2022 09:16
Show Gist options
  • Save shalperin/949f8b6481491b64b54703dcab35c2d5 to your computer and use it in GitHub Desktop.
Save shalperin/949f8b6481491b64b54703dcab35c2d5 to your computer and use it in GitHub Desktop.
Deal with extraneous cameras generated by Sketchup Scenes for an XR Rig.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraManager : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Camera[] allCameras = FindObjectsOfType<Camera>();
foreach (Camera c in allCameras)
{
c.enabled = false;
}
Camera vrRig = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
vrRig.enabled = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment