Version: 2017.4
public bool didUpdateThisFrame ;

説明

最後のフレームから更新されているかどうか

このメソッドは、ビデオバッファが最後のフレームから変更されているかを確認するのに使用します。低フレーム率を設定すると、 ビデオ更新はゲームより時間がかかる傾向があります。そのため、各 Update 呼び出しで、負荷の高いビデオ処理を行うのはあまりよい方法とは言えません。 処理を行う前には、この値を確認してください。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public WebCamTexture webcamTexture; public Color32[] data; void Start() { webcamTexture = new WebCamTexture(); webcamTexture.Play(); data = new Color32[webcamTexture.width * webcamTexture.height]; } void Update() { if (webcamTexture.didUpdateThisFrame) webcamTexture.GetPixels32(data); } }