正文  多媒体 > 摄像头/Camera >

android+unity游戏开发之摄像头切换

using UnityEngine; using System.Collections; public class test : MonoBehaviour {...

 

 

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; 

 

  \

       注:当然得新建一个GUISkin,和两个Camera啦

 

摘自 dlnuchunge的专栏