Ejemplo n.º 1
0
    /// <summary>
    /// 复制补丁文件到主目录
    /// <param name="targetPackageVersion">目标补丁版本。如果版本为负值则拷贝所有版本</param>
    /// </summary>
    public static void CopyPackageToManifestFolder(BuildTarget buildTarget, string outputRoot, int targetPackageVersion = -1)
    {
        string parentPath = $"{outputRoot}/{buildTarget}";
        string outputPath = $"{outputRoot}/{buildTarget}/{PatchDefine.StrManifestFileName}";

        // 获取所有Package文件夹
        List <int> versionList = GetPackageVersionList(buildTarget, outputRoot);

        // 拷贝资源
        for (int i = 0; i < versionList.Count; i++)
        {
            if (targetPackageVersion >= 0 && versionList[i] > targetPackageVersion)
            {
                break;
            }

            string sourcePath = $"{parentPath}/{versionList[i]}";
            Debug.Log($"拷贝版本文件到主目录:{sourcePath}");
            EditorTools.CopyDirectory(sourcePath, outputPath);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 复制补丁文件到流目录
    /// </summary>
    /// <param name="targetPackageVersion">目标补丁版本。如果版本为负值则拷贝所有版本</param>
    public static void CopyPackageToStreamingFolder(BuildTarget buildTarget, string outputRoot, int targetPackageVersion = -1)
    {
        string parentPath    = $"{outputRoot}/{buildTarget}";
        string streamingPath = Application.dataPath + "/StreamingAssets";

        // 获取所有Package文件夹
        List <int> versionList = GetPackageVersionList(buildTarget, outputRoot);

        // 拷贝资源
        for (int i = 0; i < versionList.Count; i++)
        {
            if (targetPackageVersion >= 0 && versionList[i] > targetPackageVersion)
            {
                break;
            }

            string sourcePath = $"{parentPath}/{versionList[i]}";
            Debug.Log($"拷贝版本文件到流目录:{sourcePath}");
            EditorTools.CopyDirectory(sourcePath, streamingPath);
        }
    }