Init repository

This commit is contained in:
2024-01-27 08:49:55 +08:00
commit f86a72355b
311 changed files with 121739 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
using System.IO;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Video;
public class VideoBundleLoader : MonoBehaviour
{
public AssetBundle VideoAssetBundle;
public string VideoAssetBundleName = "VideoAssets.bunl";
private void Start()
{
SceneManager.activeSceneChanged += delegate
{
if (VideoAssetBundle)
VideoAssetBundle.Unload(true);
};
VideoAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "Video", VideoAssetBundleName));
}
public VideoClip GetVideoClipFromAssetBundle(AssetBundle VideoAssetBundle, string VideoFileName)
{
return VideoAssetBundle.LoadAsset<VideoClip>(VideoFileName);
}
}