/// <summary> /// Initialize the attributes of the capture session and start capture. /// </summary> public override void StartCapture() { if (status != StatusType.NOT_START && status != StatusType.FINISH) { Debug.LogWarning("[VideoCaptureProCtrl::StartCapture] Previous " + " capture not finish yet!"); return; } // Filter out disabled capture component. List <VideoCapturePro> validCaptures = new List <VideoCapturePro>(); if (validCaptures != null && videoCaptures.Length > 0) { foreach (VideoCapturePro videoCapture in videoCaptures) { if (videoCapture != null && videoCapture.gameObject.activeSelf) { validCaptures.Add(videoCapture); } } } videoCaptures = validCaptures.ToArray(); for (int i = 0; i < videoCaptures.Length; i++) { VideoCapturePro videoCapture = (VideoCapturePro)videoCaptures[i]; if (videoCapture == null || !videoCapture.gameObject.activeSelf) { continue; } videoCapture.StartCapture(); } status = StatusType.STARTED; }
/// <summary> /// Initial instance and init variable. /// </summary> protected override void Awake() { base.Awake(); // For easy access the CameraCaptures var. if (videoCaptures == null) { videoCaptures = new VideoCapturePro[0]; } // Create default root folder if not created. if (!Directory.Exists(PathConfig.saveFolder)) { Directory.CreateDirectory(PathConfig.saveFolder); } status = StatusType.NOT_START; }