/// <summary> /// 载入Resources资源 /// </summary> /// <param name="_AssetsName">_curPathname 是相对于path/Date/下的路径 例如目录结构Assets/Resources/Date/ +_curPathname</param> /// <returns></returns> public Object LoadResources(string _AssetsName) { if (_AssetsName == null || _AssetsName.Equals("")) { return(null); } _AssetsName = BaseBundle.DeleteSuffixName(_AssetsName).ToLower(); if (mBundleList.Contains(_AssetsName)) { return((Object)mBundleList[_AssetsName].Retain()); } ResourcesBundle tbundle = new ResourcesBundle(_AssetsName); AddCache(tbundle); tbundle.Load(this); return((Object)tbundle.Retain()); }
/// <summary> /// /// </summary> /// <param name="needs"></param> /// <returns></returns> private IEnumerator LoadUnityAssetsBundle(AssetParameter[] needs, UnityAssetManager unityAssetManager) { foreach (AssetParameter par in needs) { if (DebugMode) { UnityEngine.Object assetObject = Resources.Load(par.Path); ResourcesBundle tem = new ResourcesBundle((UnityAssetManager)GTLib.AssetManager, par, assetObject); yield return(tem); } else { string path = GetPath(par); byte[] stream = File.ReadAllBytes(path); AssetBundle bundle = AssetBundle.CreateFromMemoryImmediate(stream); UnityAssetsBundle tem = new UnityAssetsBundle((UnityAssetManager)GTLib.AssetManager, par); tem.SetAssetBundle(bundle); yield return(tem); } } yield return(null); syLoadUnityAssetsBundle = null; }