Init repository
This commit is contained in:
Executable file
+26
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user