Skip to content

Commit 99f5ee0

Browse files
Revise text with Addressable example
Also update scripts to match by SerializedFile and not AssetBundle because of the hash in name option from Addressables.
1 parent 5dc4ea0 commit 99f5ee0

File tree

7 files changed

+192
-35
lines changed

7 files changed

+192
-35
lines changed
13.1 KB
Loading
Loading

Documentation/RemoveHashName.png

53.1 KB
Loading

Documentation/comparing-builds.md

Lines changed: 187 additions & 29 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The UnityDataTool is a command line tool and showcase of the UnityFileSystemApi
44
The main purpose is for analysis of the content of Unity data files, for example AssetBundles and
55
Player content.
66

7-
The [command line tool](./UnityDataTool/README.md) runs directly on Unity data files, without requiring the Editor to be running. It covers functionality of the Unity tools WebExtract and binary2text, with better performance. And it adds a lot of additional functionality, for example the ability to create a SQLite database for detailed analysis of build content (See [examples](./Documentation/analyze-examples.md) for more detail).
7+
The [command line tool](./UnityDataTool/README.md) runs directly on Unity data files, without requiring the Editor to be running. It covers most functionality of the Unity tools WebExtract and binary2text, with better performance. And it adds a lot of additional functionality, for example the ability to create a SQLite database for detailed analysis of build content. See [examples](./Documentation/analyze-examples.md) and [comparing builds](./Documentation/comparing-builds.md) for examples of how to use the command line tool.
88

99
It is designed to scale for large build outputs and has been used to fine-tune big Unity-based games.
1010

Scripts/comparebuilds.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ if (-not (Test-Path $db2)) {
3333

3434
# SQL query to compare the content of two builds.
3535
# Note: when the ID of an object changes then it will not be matched as the same.
36+
# Note: matching is done based on the SerializedFile, but not the AssetBundle name. In this way AssetBundles that include
37+
# the content hash in the name can still be compared.
3638
$query = @"
3739
ATTACH DATABASE '$db2' AS db2;
3840
@@ -86,8 +88,7 @@ FULL OUTER JOIN (
8688
db2.serialized_files sf ON o.serialized_file = sf.id
8789
LEFT JOIN
8890
db2.asset_bundles ab ON sf.asset_bundle = ab.id
89-
) AS o2 ON o1.asset_bundle = o2.asset_bundle
90-
AND o1.object_id = o2.object_id
91+
) AS o2 ON o1.object_id = o2.object_id
9192
AND o1.type = o2.type
9293
AND o1.name = o2.name
9394
AND o1.serialized_file = o2.serialized_file;
@@ -96,6 +97,5 @@ DETACH DATABASE db2;
9697
"@
9798

9899
# Execute the query
99-
Write-Host "Objects with differences, only in one DB, or the same:"
100100
$results = sqlite3 $db1 ".mode column" $query
101101
$results | ForEach-Object { Write-Output $_ }

Scripts/comparebundles.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ FULL OUTER JOIN (
105105
db2.serialized_files sf ON o.serialized_file = sf.id
106106
LEFT JOIN
107107
db2.asset_bundles ab ON sf.asset_bundle = ab.id
108-
) AS o2 ON o1.asset_bundle = o2.asset_bundle
108+
) AS o2 ON o1.serialized_file = o2.serialized_file
109109
AND o1.object_id = o2.object_id
110-
AND o1.serialized_file = o2.serialized_file
111110
WHERE NOT (o1.asset_bundle IS NOT NULL AND o2.asset_bundle IS NOT NULL AND o1.crc32 = o2.crc32 AND o1.size = o2.size);
112111
113112
DETACH DATABASE db2;

0 commit comments

Comments
 (0)