Beispiel #1
0
    private IEnumerator GetImageCoroutine(OnCameraImage callback)
    {
        yield return(new WaitForEndOfFrame());

        Texture2D texture = new Texture2D(_webcamTexture.width, _webcamTexture.height);

        texture.SetPixels(_webcamTexture.GetPixels());
        texture.Apply();

        if (callback != null)
        {
            callback.Invoke(texture);
        }
    }
Beispiel #2
0
 public void GetImage(OnCameraImage callback)
 {
     StartCoroutine(GetImageCoroutine(callback));
 }