// Use this for initialization void Start() { //カメラ準備 WebCamDevice[] devices = WebCamTexture.devices; webcamTexture = new WebCamTexture(devices[0].name, Width, Height, FPS); GetComponent <Renderer>().material.mainTexture = webcamTexture; webcamTexture.Play(); //QRコード管理クラス this.qrManager = new PQRCodeManager(); }
// Use this for initialization void Start() { //カメラ準備 WebCamDevice[] devices = WebCamTexture.devices; webcamTexture = new WebCamTexture(devices[0].name, (int)screenSize.y, (int)screenSize.x, FPS); GetComponent <MeshRenderer> ().material.mainTexture = webcamTexture; webcamTexture.Play(); //QRコード管理クラス this.qrManager = new PQRCodeManager(); }
void Start() { Application.targetFrameRate = 30; SetScreenSize(); //デバイスを取得 devices = WebCamTexture.devices; if (devices.Length > 0) { cameraNum = devices.Length - 1; selectedCameraId = cameraNum; webcamTexture = new WebCamTexture(devices[selectedCameraId].name, (int)screenSize.y, (int)screenSize.x); webcamTexture.Play(); FitQuadSize(); GetComponent <MeshRenderer> ().material.mainTexture = webcamTexture; //QRコード管理クラス this.qrManager = new PQRCodeManager(); init = true; } else { Debug.Log("カメラなし"); // 確認のみのダイアログ /** * * "カメラにアクセスできません", * "設定>プライバシー>カメラ>(このアプリ名)で、許可をお願いします", */ return; } }