camera.DOAspect()
camera.DOAspect()
给相机挂载脚本
//Camera camera = GetComponent<Camera>();
////改变屏幕的宽高比
//camera.DOAspect(0.5f,2);
////改变颜色
//camera.DOColor(Color.red,2);
//启用协程
StartCoroutine(ChangeColor());
}
/// <summary>
/// 创建协程方法
/// </summary>
IEnumerator ChangeColor() {
Camera camera = GetComponent<Camera>();
//这个颜色是渐变的,时间越长效果突出
camera.DOColor(Color.red, 0.1f);
yield return new WaitForSeconds(0.1f);
camera.DOColor(Color.blue, 5);
yield return new WaitForSeconds(5);
camera.DOColor(Color.red, 0.1f);
yield return new WaitForSeconds(0.1f);
camera.DOColor(Color.blue, 5);
}//近切面
camera.DONearClipPlane(2,2);
//远切面
// camera.DOFarClipPlane(2,2);