Example #1
0
        /// <summary>
        /// 加载 Assets SourceAssets 文件夹下资源
        /// </summary>
        /// <param name="resName">加载的资源名字</param>
        /// <param name="bundPath">导入 AssetBundle 路径</param>
        /// <param name="type">资源的类型</param>
        /// <returns></returns>
        private static LoadSourceEntity LoadBuildSources(string resName, string bundPath)
        {
            if (string.IsNullOrEmpty(bundPath))
            {
                bundPath = resName;
            }
            string path = LCSPathHelper.UnityBuildRootPath() + bundPath;

            return(LoadBinarySources(path, resName));
        }
Example #2
0
        /// <summary>
        /// 加载打包资源文件夹
        ///
        /// SourceAssets 下的文件
        ///
        /// entity.BundlePath  相对于 SourceAssets 文件夹路径
        /// </summary>
        /// <param name="entity">资源管理实体</param>
        /// <param name="callback">资源管理类的回调函数</param>
        private void LoadBuildSources(LoadSourceEntity entity, Action <LoadSourceEntity> callback)
        {
            if (entity == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(entity.BundlePath))
            {
                entity.BundlePath = entity.ResName;
            }
            string loadPath = LCSPathHelper.UnityBuildRootPath() + entity.BundlePath;

            LoadBinarySources(entity, loadPath, callback);
        }