Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CamChangerSpace : MonoBehaviour {
- public Camera Cam1White, Cam2Black;
- public KeyCode space;
- public bool camSwitch = false;
- void Update()
- {
- if (Input.GetKeyDown("space"))
- {
- MyButtonMethod();
- }
- }
- public void MyButtonMethod()
- {
- camSwitch = !camSwitch;
- Cam1White.gameObject.SetActive(camSwitch);
- Cam2Black.gameObject.SetActive(!camSwitch);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement