public void OnStop() { if (CamTexture == null) { return; } CamTexture.Stop(); }
public void OnPause() { if (CamTexture == null) { return; } CamTexture.Pause(); }
public byte[] OnCapture() { if (CamTexture == null) { return(null); } Texture2D photo = new Texture2D(CamTexture.width, CamTexture.height); photo.SetPixels(CamTexture.GetPixels()); photo.Apply(); //Encode to a PNG byte[] bytes = photo.EncodeToPNG(); return(bytes); }