#region Copyright RenGuiYou. All rights reserved. //===================================================== // NeatlyFrameWork // Author: RenGuiyou // Feedback: mailto:750539605@qq.com //===================================================== #endregion using Neatly.Module; using UnityEngine; using UnityEngine.Video; namespace Neatly.Load.Manager { public class VideoLoadManager : Singleton { private LoadModule m_LoadModule; public void Init(LoadModule loadModule) { m_LoadModule = loadModule; } private string makeEditorPath(string fileName) { string path = string.Format("data/{0}/{1}{2}", NeatlyConfig.VIDEO_PACKAGE, fileName, NeatlyConfig.SUFFIX_VIDEO); return path; } public VideoClip LoadVideo(string fileName) { #if UNITY_EDITOR if (m_LoadModule.GetUseBundle()) #endif { var result = m_LoadModule.LoadAssetBundleDirect(NeatlyConfig.VIDEO_PACKAGE).ResultObject; var videoBundle = result as AssetBundle; var videolip = videoBundle.LoadAsset(fileName); return videolip; } #if UNITY_EDITOR return m_LoadModule.LoadAssetFileSync(makeEditorPath(fileName)); #endif } } }