添加缺失插件

This commit is contained in:
YXY
2026-03-03 18:24:17 +08:00
parent d43882c5cf
commit c979cd2a92
90 changed files with 5269 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
/// <summary>
/// 360视频播放控制组件用来读取外部视频文件
/// </summary>
public class Video360Controller : MonoBehaviour
{
private VideoPlayer mVideoPlayer;
public string VideoNameStr = "";
public double Time = 0;
private void Awake()
{
mVideoPlayer = gameObject.GetComponent<VideoPlayer>();
mVideoPlayer.started += MVideoPlayer_started;
mVideoPlayer.prepareCompleted += MVideoPlayer_prepareCompleted;
PrepareVide(VideoNameStr);
}
public bool isPlaying
{
get { return mVideoPlayer.isPlaying; }
}
private void MVideoPlayer_started(VideoPlayer source)
{
if (Time != 0)
{
MVideoPlayer_started(Time);
}
}
private void MVideoPlayer_prepareCompleted(VideoPlayer source)
{
mVideoPlayer.Play();
}
public void MVideoPlayer_started(double mtime)
{
if (Time >= mVideoPlayer.length)
{
mVideoPlayer.time = mVideoPlayer.length;
return;
}
mVideoPlayer.time = mtime;
}
public void PrepareVide(string name)
{
try
{
string videoPath = FileLoad.GetMoviesFolder() + name;
Debug.Log($"目录检测{videoPath}");
mVideoPlayer.url = videoPath;
mVideoPlayer.Prepare();
}
catch (System.Exception e)
{
Debug.LogError(e.Message);
}
}
private void OnDisable()
{
Time = 0;
}
}