// Update is called once per frame public void SwitchCamera() { MainCamera.GetComponent <Camera>().enabled = !MainCamera.GetComponent <Camera>().enabled; MainCanvas.SetActive(!MainCanvas.activeSelf); Camera2nd.GetComponent <Camera>().enabled = !Camera2nd.GetComponent <Camera>().enabled; SecondCanvas.SetActive(!SecondCanvas.activeSelf); }
void Start() { MainCamera.GetComponent <Camera>().enabled = true; MainCanvas.SetActive(true); Camera2nd.GetComponent <Camera>().enabled = false; SecondCanvas.SetActive(false); }