如果Cube移动和旋转时,按下空格键,相机拍下的也只是一张照片,不是录像。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CAR : MonoBehaviour {
public GameObject Camera;
void Start () {
}
// Update is called once per frame
void Update () {
//按下空格键,截图cube的一张照片
if (Input.GetKeyDown("space"))
{
GetComponent<Camera>().targetTexture = null;
}
}
}