using UnityEngine; using RenderHeads.Media.AVProMovieCapture; using System.IO; using System; /// /// 录屏 /// public class SaveVideoToPersistentData : MonoBehaviour { public static SaveVideoToPersistentData saveVideoToPersistent; public CaptureBase _movieCapture = null; public bool isPlayer = false; private void Start() { saveVideoToPersistent = this; } public void StartCapture() { if (_movieCapture != null) { isPlayer = true; string _name = GlobalFlag.practiceSubjectID+ ".mp4"; Debug.Log("Name:" + _name); _movieCapture._Mp4Name = _name; _movieCapture.StartCapture(); } } public void StopCapture() { if (_movieCapture != null && isPlayer) { _movieCapture.StopCapture(); } } }