ShanxiKnowledgeBase/SXElectricalInspection/Assets/AVIDEO/UIS.cs

61 lines
1.6 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIS : MonoBehaviour
{
[Header("开始录制按钮")]
public Button StartClick;
[Header("暂停录制按钮")]
public Button PauseClick;
[Header("停止录制按钮")]
public Button StopClick;
[Header("保存路径")]
public string path;
[Header("保存名字")]
public string MP4Name;
// Start is called before the first frame update
void Start()
{
path = Application.streamingAssetsPath;
//StartClick.onClick.AddListener(() =>
//{
// MP4Name = string.Format("{0}_{1}_{2}_{3}_{4}", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute);
// ScreenCaptureManager.instance.StartCapture(path, MP4Name);
//});
//PauseClick.onClick.AddListener(() =>
//{
// ScreenCaptureManager.instance.PauseCapture();
//});
//StopClick.onClick.AddListener(() =>
//{
// ScreenCaptureManager.instance.StopCapture();
//});
}
public void OnStartRecorad()
{
MP4Name = string.Format("{0}_{1}_{2}_{3}_{4}", DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, GlobalFlag.systemUserId, GlobalFlag.userName);
//ScreenCaptureManager.instance.CaptureInit();
ScreenCaptureManager.instance.StartCapture(path, MP4Name);
}
public void OnStopRecorad()
{
ScreenCaptureManager.instance.StopCapture();
}
}