void Update() { if (Input.GetKeyUp(startCapture)) { videoCapture.StartCapture(); } else if (Input.GetKeyUp(stopCapture)) { videoCapture.StopCapture(); } else if (Input.GetKeyUp(cancelCapture)) { videoCapture.CancelCapture(); } }
private void OnGUI() { if ( videoCapture.status == CaptureStatus.READY) { if (GUI.Button(new Rect(10, Screen.height - 60, 150, 50), "Start Capture")) { videoCapture.StartCapture(); } } else if (videoCapture.status == CaptureStatus.STARTED) { if (GUI.Button(new Rect(10, Screen.height - 60, 150, 50), "Stop Capture")) { videoCapture.StopCapture(); } if (GUI.Button(new Rect(170, Screen.height - 60, 150, 50), "Cancel Capture")) { videoCapture.CancelCapture(); } } else if (videoCapture.status == CaptureStatus.PENDING) { if (GUI.Button(new Rect(10, Screen.height - 60, 150, 50), "Muxing")) { // Waiting processing end } } else if (videoCapture.status == CaptureStatus.STOPPED) { if (GUI.Button(new Rect(10, Screen.height - 60, 150, 50), "Encoding")) { // Waiting processing end } } if (GUI.Button(new Rect(Screen.width - 160, Screen.height - 60, 150, 50), "Browse")) { // Open video save directory Utils.BrowseFolder(videoCapture.saveFolder); } }