Exemple #1
0
        //Source packages 是指 VFS打包资源后的输出目录,里面包括"vfs_root","vfs_data"什么的那个目录

        /// <summary>
        /// 检查在给定的根目录下,是否有有效的MainPackage文件
        /// </summary>
        /// <returns></returns>
        internal static bool IsValid_MainPackage_InPackages(string packages_root_path, bool runtime_used = false)
        {
            //检查是否有vfs_root目录
            string vfs_root = VFSUtil.GetMainPackageFolderInPackages(packages_root_path);

            if (!Directory.Exists(vfs_root))
            {
                return(false);
            }
            //检查data目录
            if (!Directory.Exists(VFSUtil.GetDataFolderInPackages(packages_root_path)))
            {
                return(false);
            }
            //检查build_info
            if (!File.Exists(VFSUtil.GetMainPackage_BuildInfo_Path(packages_root_path)))
            {
                return(false);
            }

            if (!runtime_used)
            {
                //检查asset_hash
                if (!File.Exists(VFSEditorUtil.GetMainPackage_AssetsHash_FilePath_InPackages(packages_root_path)))
                {
                    return(false);
                }
                //检查editor build_info
                if (!File.Exists(VFSEditorUtil.Get_EditorBuildInfoPath(packages_root_path)))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
 /// <summary>
 /// 获取 Source Pakcages 下的 Main Package 的 本地文件存放目录 (vfs_root)
 /// </summary>
 /// <param name="platform_name"></param>
 /// <returns></returns>
 public static string Get_MainPackage_AssetsFolderPath_InSourcePackages(string platform_name)
 {
     return(VFSUtil.GetMainPackageFolderInPackages(GetSourcePackagesFolderPath(platform_name)));
 }