public class CameraCut : MonoBehaviour {
private GameObject camera01;
private GameObject camera02;
void Start () {
camera01 = GameObject.Find("camera01");
camera02= GameObject.Find("camera02");
camera01.SetActive(true);
camera02.SetActive(false);
}
void Update () {
if (Input.GetKey(KeyCode.Alpha1))//按下键盘数字1
{
camera01.SetActive(true);
camera02.SetActive(false);
}
if (Input.GetKey(KeyCode.Alpha2))//按下键盘数字2
{
camera01.SetActive(false);
camera02.SetActive(true);
}
}
}
相机切换
最新推荐文章于 2024-09-04 10:30:12 发布