适用场景:
指定相机,随着程序运行,相机间切换
实现思想:
通过改变相机激活状态,以及延时调用函数Invoke实现
代码如下:
public GameObject camera_0;
public GameObject camera_1;
public GameObject camera_2;
private void changeZero()
{
camera_0.SetActive(true);
camera_1.SetActive(false);
camera_2.SetActive(false);
Invork("changeOne", 1f);
}
private void changeOne()
{
camera_0.SetActive(false);
camera_1.SetActive(true);
camera_2.SetActive(false);
Invoke("changeTwo", 1f);
}
private void changeTwo()
{
camera_0.SetActive(false);
camera_1.SetActive(false);
camera_2.SetActive(true);
Invoke("changeZero", 1f);
}