Advertisement
Guest User

Untitled

a guest
Sep 14th, 2011
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GUIViews : MonoBehaviour
  5. {
  6.     private bool inProgress = false;
  7.     public Camera cam1;
  8.     public Camera cam2;
  9.     private bool swap = true;
  10.  
  11.     void Update()
  12.     {
  13.     if (Input.GetKeyDown("space")) {
  14.         StartCoroutine(ChangeCam());
  15.     }
  16.     }
  17.  
  18.     IEnumerator ChangeCam()
  19.     {
  20.     if (inProgress) yield return 0;
  21.     inProgress = true;
  22.  
  23.     yield return ScreenWipe.use.CrossFade(swap?cam1:cam2, swap?cam2:cam1, 2);
  24.  
  25.     swap = !swap;
  26.  
  27.     inProgress = false;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement