Android+Unity游戲開發之攝像頭切換代碼:
- using UnityEngine;
- using System.Collections;
- public class test : MonoBehaviour {
- public GUISkin MenuGUIskins;
- public Camera camera1;
- public Camera camera0;
- void Start () {}
- void Update () {}
- void OnGUI () {
-
- GUI.skin=MenuGUIskins;
-
- if(GUI.Button(new Rect(100, 0,190,60),"di1rencheng")){
- camera1.enabled = false;
- camera0.enabled = true;
-
- }
- else if(GUI.Button(new Rect(100, 75,190,60),"di3rencheng")){
- camera1.enabled = true;
- camera0.enabled = false;
-
- }
- }
- }