Created
July 17, 2022 09:16
-
-
Save shalperin/949f8b6481491b64b54703dcab35c2d5 to your computer and use it in GitHub Desktop.
Deal with extraneous cameras generated by Sketchup Scenes for an XR Rig.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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