Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class GUIViews : MonoBehaviour
- {
- private bool inProgress = false;
- public Camera cam1;
- public Camera cam2;
- private bool swap = true;
- void Update()
- {
- if (Input.GetKeyDown("space")) {
- StartCoroutine(ChangeCam());
- }
- }
- IEnumerator ChangeCam()
- {
- if (inProgress) yield return 0;
- inProgress = true;
- yield return ScreenWipe.use.CrossFade(swap?cam1:cam2, swap?cam2:cam1, 2);
- swap = !swap;
- inProgress = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement