95 lines
2.3 KiB
C#
95 lines
2.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class VideoItem : MonoBehaviour
|
|
{
|
|
public Image m_ThumbnailImage;
|
|
//public RawImage m_RawImage;
|
|
public Text m_Text;
|
|
public Button m_Button;
|
|
public Image m_SelectBackGround;
|
|
public Image m_ImageToggle;//勾选
|
|
|
|
public string m_Practice;
|
|
public string m_Ship;
|
|
public string m_Subject;
|
|
public string m_User;
|
|
public string m_Time;
|
|
public string m_Length;
|
|
/// <summary>
|
|
/// 视频名称
|
|
/// </summary>
|
|
public string m_MyName;
|
|
/// <summary>
|
|
/// 视频所在文件夹名称
|
|
/// </summary>
|
|
public string m_Folder;
|
|
/// <summary>
|
|
/// 视频路径
|
|
/// </summary>
|
|
public string m_MyPath;
|
|
|
|
public bool m_DeleteMode;
|
|
public bool m_Selection;
|
|
|
|
private void Start()
|
|
{
|
|
//m_ThumbnailImage = GetComponentInChildren<Image>();
|
|
m_Text = GetComponentInChildren<Text>();
|
|
m_Button = GetComponentInChildren<Button>();
|
|
m_Button.onClick.AddListener(() =>
|
|
{
|
|
if (!m_DeleteMode)
|
|
{
|
|
MediaPlayerController.instance._MediaPath = System.IO.Path.Combine("ScreenCaptures", m_Folder);
|
|
Debug.Log(MediaPlayerController.instance._MediaPath);
|
|
Debug.Log(m_Folder);
|
|
MediaPlayerController.instance._MediaFile = m_MyName;
|
|
|
|
}
|
|
else
|
|
{
|
|
m_Selection = !m_Selection;
|
|
if (m_Selection)
|
|
{
|
|
m_ImageToggle.gameObject.SetActive(true);
|
|
|
|
}
|
|
else
|
|
{
|
|
m_ImageToggle.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除模式
|
|
/// </summary>
|
|
public void OnDeleteMode()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 选择模式
|
|
/// </summary>
|
|
public void OnSelectionMode()
|
|
{
|
|
m_SelectBackGround.gameObject.SetActive(true);
|
|
m_DeleteMode = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 退出选择模式
|
|
/// </summary>
|
|
public void OnExitSelectionMode()
|
|
{
|
|
m_ImageToggle.gameObject.SetActive(false);
|
|
m_SelectBackGround.gameObject.SetActive(false);
|
|
m_DeleteMode = false;
|
|
m_Selection = false;
|
|
}
|
|
} |