Esempio n. 1
0
 void OnApplicationPause(bool paused)
 {
     if (paused)
     {
         LiveTextureBinding.stopCameraCapture();
         texture = null;
     }
 }
Esempio n. 2
0
        void OnGUI()
        {
            beginColumn();


            if (GUILayout.Button("Request Access to Camera"))
            {
                LiveTextureBinding.requestAccessToCamera();
            }


            if (GUILayout.Button("Start Capture (low)"))
            {
                // start the camera capture and use the returned texture
                texture = LiveTextureBinding.startCameraCapture(false, LTCapturePreset.Size192x144);
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = texture;
                LiveTextureBinding.updateMaterialUVScaleForTexture(target.GetComponent <Renderer>().sharedMaterial, texture);
                _isCameraCaptureStarted = true;
            }


            if (GUILayout.Button("Start Capture (high)"))
            {
                texture = LiveTextureBinding.startCameraCapture(false, LTCapturePreset.Size1280x720);
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = texture;
                LiveTextureBinding.updateMaterialUVScaleForTexture(target.GetComponent <Renderer>().sharedMaterial, texture);
                _isCameraCaptureStarted = true;
            }


            if (GUILayout.Button("Start Capture (ultra high)"))
            {
                texture = LiveTextureBinding.startCameraCapture(false, LTCapturePreset.Size1920x1080);
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = texture;
                LiveTextureBinding.updateMaterialUVScaleForTexture(target.GetComponent <Renderer>().sharedMaterial, texture);
                _isCameraCaptureStarted = true;
            }


            if (GUILayout.Button("Start Capture (front, low)"))
            {
                texture = LiveTextureBinding.startCameraCapture(true, LTCapturePreset.Size192x144);
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = texture;
                LiveTextureBinding.updateMaterialUVScaleForTexture(target.GetComponent <Renderer>().sharedMaterial, texture);
                _isCameraCaptureStarted = true;
            }


            if (GUILayout.Button("Start Capture (front, high)"))
            {
                texture = LiveTextureBinding.startCameraCapture(true, LTCapturePreset.Size640x480);
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = texture;
                LiveTextureBinding.updateMaterialUVScaleForTexture(target.GetComponent <Renderer>().sharedMaterial, texture);
                _isCameraCaptureStarted = true;
            }


            if (GUILayout.Button("Stop Capture"))
            {
                LiveTextureBinding.stopCameraCapture();
                texture = null;
                _isCameraCaptureStarted = false;
                target.GetComponent <Renderer>().sharedMaterial.mainTexture = _yellowTexture;
            }


            endColumn(true);


            if (GUILayout.Button("Start Recording Video"))
            {
                LiveTextureBinding.startRecordingCameraOutput("livetexture.mp4");
            }


            if (GUILayout.Button("Stop Recording Video"))
            {
                LiveTextureBinding.stopRecordingCameraOutput();
            }


            if (_isCameraCaptureStarted && GUILayout.Button("Set Exposure Mode"))
            {
                LiveTextureBinding.setExposureMode(LTExposureMode.ContinuousAutoExposure);
            }


            if (_isCameraCaptureStarted && GUILayout.Button("Set Focus Mode"))
            {
                LiveTextureBinding.setFocusMode(LTFocusMode.ContinuousAutoFocus);
            }


            endColumn();



            if (bottomRightButton("Next"))
            {
                LiveTextureBinding.stopCameraCapture();
                texture = null;

                Application.LoadLevel("VideoTestScene");
            }
        }
Esempio n. 3
0
 void OnApplicationQuit()
 {
     LiveTextureBinding.stopCameraCapture();
     texture = null;
 }