TexeL

Untitled

Feb 1st, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GUIController : MonoBehaviour
  5. {
  6.     private CameraController CamController;
  7.  
  8.     void Start()
  9.     {
  10.         CamController = GetComponent<CameraController>();
  11.     }
  12.    
  13.     void OnEnable()
  14.     {
  15.         GUIButton.ButtonCallEvent += ButtonCall;
  16.     }
  17.  
  18.     void OnDisable()
  19.     {
  20.         GUIButton.ButtonCallEvent -= ButtonCall;
  21.     }
  22.  
  23.  
  24.     void ButtonCall(int id)
  25.     {
  26.         switch (id)
  27.         {
  28.             case 1:
  29.                 CamController.SetCamera(1);
  30.                 break;
  31.             case 2:
  32.                 CamController.SetCamera(1);
  33.                 break;
  34.             case 3:
  35.                 CamController.SetCamera(3);
  36.                 break;
  37.             case 4:
  38.                 CamController.SetCamera(2);
  39.                 break;
  40.             case 5:
  41.                 CamController.SetCamera(0);
  42.                 break;
  43.             case 6:
  44.                 CamController.SetCamera(4);
  45.                 break;
  46.             case 7:
  47.                 Application.Quit();
  48.                 break;
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment