Пример #1
0
        /// <summary>
        /// 获取文件的完整路径
        /// </summary>
        public string FullPathForFile(string file, ResourceType resType)
        {
            string fullPath;

            if (resType == ResourceType.AssetBundle)
            {
                file = _assetBundleMgr.GetAssetBundleNameByAssetPath(file);
            }
            if (!_resourceContainer.ResourcesLoadMode)
            {
                file     = file.ToLower();
                fullPath = OUTER_FILE_SYMBOL + ResourceLoadPath + file;
                //暂时直接读streaming中bundle文件(后期做bundle压缩的时候再换)
                //fullPath = FILE_SYMBOL + StreamingAssetsPath + file;
            }
            else
            {
                //如果是resource模式加载,移除后缀
                int index = file.LastIndexOf(".");
                if (index > -1)
                {
                    file = file.Substring(0, index);
                }
                fullPath = file;
            }
            return(fullPath);
        }
Пример #2
0
 private string GetRealResourcePath(string resPath)
 {
     if (string.IsNullOrEmpty(resPath))
     {
         return(resPath);
     }
     if (DirectLoadMode)
     {
         return(resPath);
     }
     return(_assetBundleFile.GetAssetBundleNameByAssetPath(resPath));
 }
Пример #3
0
        private string[] GetDependResPath(Resource res)
        {
            string resName = _assetBundleFile.GetAssetBundleNameByAssetPath(res.path);

            return(_assetBundleFile.GetDirectDependencies(resName));
        }