コード例 #1
0
ファイル: ResMgrBase.cs プロジェクト: ZhaoriGame/FrameworkPro
 /// <summary>
 /// 如果AB名称有后缀,则去掉
 /// </summary>
 /// <param name="abName"></param>
 /// <returns></returns>
 protected string ABNameWithoutExtension(string abName)
 {
     if (abName.EndsWith(HotResConst.AB_EXTENSION))
     {
         abName = abName.Replace(HotResConst.AB_EXTENSION, "");
     }
     abName = FileSystem.StandardizeBackslashSeparator(abName);
     return(abName);
 }
コード例 #2
0
ファイル: ResMgrBase.cs プロジェクト: ZhaoriGame/FrameworkPro
 /// <summary>
 /// 如果AB名称没有后缀,则加上后缀名
 /// </summary>
 /// <param name="abName"></param>
 protected string ABNameWithExtension(string abName)
 {
     if (false == abName.EndsWith(HotResConst.AB_EXTENSION))
     {
         abName += HotResConst.AB_EXTENSION;
     }
     abName = FileSystem.StandardizeBackslashSeparator(abName);
     return(abName);
 }
コード例 #3
0
        public AssetBundleResMgr(string manifestFilePath)
        {
            UnloadAll();
            _loadedABDic = new Dictionary <string, AssetBundle>();

            RootDir = FileSystem.StandardizeBackslashSeparator(Path.GetDirectoryName(manifestFilePath));

            AssetBundle ab = AssetBundle.LoadFromFile(manifestFilePath);

            _manifest = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest");
            if (_manifest == null)
            {
                throw new Exception(string.Format("错误的 Manifest File: {0}", manifestFilePath));
            }
            ab.Unload(false);
        }