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;

}
}
}



android+unity游戏开发之摄像头切换_第1张图片

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

你可能感兴趣的:(游戏,android,Class)