public static string GetCompressedSizeReadingFromLog()
{
const string COMPRESSED_BUILD_SIZE_STA_KEY = "Total compressed size ";
const string COMPRESSED_BUILD_SIZE_END_KEY = ". Total uncompressed size ";
string result = "";
foreach (string line in DldUtil.BigFileReader.ReadFile(_lastEditorLogPath, COMPRESSED_BUILD_SIZE_STA_KEY))
{
int compressedBuildSizeIdx = line.LastIndexOf(COMPRESSED_BUILD_SIZE_STA_KEY);
if (compressedBuildSizeIdx != -1)
{
// this data in the editor log only shows in web builds so far
// meaning we do not get a compressed result in other builds (except android, where we can check the file size of the .apk itself)
//
int compressedBuildSizeEndIdx = line.IndexOf(COMPRESSED_BUILD_SIZE_END_KEY, compressedBuildSizeIdx);
result = line.Substring(compressedBuildSizeIdx+COMPRESSED_BUILD_SIZE_STA_KEY.Length, compressedBuildSizeEndIdx - compressedBuildSizeIdx - COMPRESSED_BUILD_SIZE_STA_KEY.Length);
}
break;
}
Debug.Log("compressed size from log: " + result);
return result;
}