// 备份当前渠道 static void BackupCurChannel(String channelPath) { string sourcePath = @"Assets/"; EditorUtility.DisplayProgressBar("备份资源到:" + channelPath, "开始备份", 0); for (int i = 0; i < pathList.Length; i++) { string path = pathList[i]; EditorUtility.DisplayProgressBar("备份资源到:" + channelPath, path, ((float)i / pathList.Length)); try { BuildAPK.DeleteFolder(channelPath + path, outSidePath); BuildAPK.CopyFolder(sourcePath + path, channelPath + path, outSidePath); } catch (Exception e) { Debug.Log(path + "路径有误"); Debug.Log(e.Message); EditorUtility.ClearProgressBar(); } } EditorUtility.ClearProgressBar(); // 刷新资源 AssetDatabase.Refresh(); }
// 恢复指定渠道 static void ResetTOChannel(String sourcePath) { string destPath = @"Assets/"; EditorUtility.DisplayProgressBar("恢复资源:" + sourcePath, "开始恢复", 0); for (int i = 0; i < pathList.Length; i++) { string path = pathList[i]; EditorUtility.DisplayProgressBar("恢复资源:" + sourcePath, path, ((float)i / pathList.Length)); try { // Debug.Log(sourcePath + path); // Debug.Log(destPath + path); // Debug.Log(outSidePath); BuildAPK.DeleteFolder(destPath + path, outSidePath); BuildAPK.CopyFolder(sourcePath + path, destPath + path, outSidePath); } catch (Exception e) { Debug.Log(path + "路径有误"); Debug.Log(e.Message); EditorUtility.ClearProgressBar(); } } EditorUtility.ClearProgressBar(); // 刷新资源 AssetDatabase.Refresh(); }