You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refine the code that filters extra files, based on further testing with player builds.
Update the documentation to explain more about when Analyse can be used.
Add a non-recursive option to reduce the noise if you only want to analyze a player build (e.g. ignore the StreamingAssets contents)
Copy file name to clipboardExpand all lines: Documentation/unity-content-format.md
+9-1
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,14 @@ To do so, the **ForceAlwaysWriteTypeTrees** Diagnostic Switch must be enabled in
50
50
51
51

52
52
53
+
54
+
Note: The `Resources\unity default resources` file is shipped with the Unity Editor and is not rebuilt when doing a Player Build. It does not have TypeTrees. Hence it is normal that this file emits errors when analyzing a player build, even after rebuilding with TypeTrees enabled. For example:
For more information about TypeTrees see the following section.
54
62
55
63
## TypeTrees
@@ -61,7 +69,7 @@ definition exactly matches the Type definition used when the object was serializ
61
69
Unity will attempt to match up the properties as best as it can, based on the property names and structure
62
70
of the data. This process is called a "Safe Binary Read" and is somewhat slower than the regular fast binary read path.
63
71
64
-
TypeTrees are important in the case of AssetBundles, to avoid rebuilding and redistributing all AssetBundles after each minor upgrade of Unity or after doing minor changes to your MonoBehaviour and ScriptableObject serialization. However there can be a noticable overhead to storing the TypeTrees in each AssetBundle, e.g. the header size of each SerializedFile is bigger.
72
+
TypeTrees are important in the case of AssetBundles, to avoid rebuilding and redistributing all AssetBundles after each minor upgrade of Unity or after doing minor changes to your MonoBehaviour and ScriptableObject serialization. However there can be a noticeable overhead to storing the TypeTrees in each AssetBundle, e.g. the header size of each SerializedFile is bigger.
65
73
66
74
TypeTrees also make it possible to load an AssetBundle in the Editor, when testing game play.
Copy file name to clipboardExpand all lines: UnityDataTool/README.md
+39-15
Original file line number
Diff line number
Diff line change
@@ -33,48 +33,72 @@ The tool is invoked from the command line like this: `UnityDataTool [command] [c
33
33
34
34
For a list of available commands run it like this: `UnityDataTool --help`
35
35
36
-
For help on a specific command use `--help` along with the command name, for example: `UnityDataTool analyse --help`
36
+
For help on a specific command use `--help` along with the command name, for example: `UnityDataTool analyze --help`
37
37
38
38
39
39
# Commands
40
40
41
41
## analyze/analyse
42
42
43
-
This command extracts information from AssetBundles and SerializedFiles and dumps the results
44
-
into a SQLite database.
43
+
This command extracts information from Unity Archives (e.g. AssetBundles) and SerializedFiles and dumps the results into a SQLite database.
45
44
46
-
The command will fail if the SerializedFiles were built without TypeTrees, see [this topic](../Documentation/unity-content-format.md) for more information.
47
45
The command takes the path of the folder containing the files to analyze as argument.
48
46
49
47
It also provides the following options:
50
48
* -o, --output-file \<database-filename\>: filename of the database that will be created, the
51
-
default is database.db.
49
+
default is database.db. Any existing file by that name will be replaced by the data from running this command.
52
50
* -s, --skip-references: skip CRC and reference (PPtrs) extraction. Faster processing and smaller
53
51
database, but inaccurate duplicate asset detection and no references table.
54
-
* -p, --search-pattern \<pattern\>: search pattern used to determine which files are AssetBundles. The default is \*. The * and ? characters are supported, but not regular expressions. The search is always recursive.
52
+
* -p, --search-pattern \<pattern\>: search pattern used to determine which files are AssetBundles. The default is \*. The * and ? characters are supported. Regular expressions are not supported.
53
+
* -v, --verbose: show more information during the analysis process, for example list any files that are ignored.
54
+
* --no-recurse: do not recurse into sub-directories.
**Refer to this [documentation](../Analyzer/README.md#How-to-use-the-database) for more information
59
59
about the output database structure.**
60
60
61
-
### Common Warnings during Analysis
61
+
Note: If a SerializedFile is built without TypeTrees, then the command will not be able to extract information about the contained objects. It will print an error similar to this example, then skip to the next file:
62
62
63
-
The analysis search may find files that are not actually Archives or SerializedFiles, for example .manifest files, text dumps etc.
See [this topic](../Documentation/unity-content-format.md) for more information about TypeTrees.
69
+
70
+
### Example Input to the Analyze command
71
+
72
+
Example of directories that could be analyzed:
64
73
65
-
This can lead to error messages like this:
74
+
* The output path of an AssetBundle build.
75
+
* A folder inside the StreamingAssets folder of a Unity Player build. For example:
76
+
* The "StreamingAssets/aa" folder, containing AssetBundles from an Addressables build.
77
+
* The "StreamingAssets/ContentArchives" folder containing sub-scene content if your project uses [Entities](https://docs.unity3d.com/Packages/[email protected]/manual/content-management-intro.html).
78
+
* The "Data" folder of a Unity Player build.
79
+
* By default, any AssetBundles or ContentArchives in the StreamingAssets folder would also be included. Use the "--no-recurse" option to avoid that.
80
+
* Compressed Player Builds are supported. The data.unity3d file will be analyzed the same way AssetBundles are.
81
+
* The structure and content of a Player varies based on the platform. In some cases you may have to first extract the content out of a platform-specific container file prior to Analysis (for example .apk files on Android).
82
+
83
+
### Filtering Other File Types
84
+
85
+
Analyze works by trying to process all files in the provided path, assuming they are all Unity Archives or SerializedFiles. Because there is no standard file extension for those files it is tricky to reliably distinguish these file types from the other files that may also be found in the build output.
86
+
87
+
This can lead to error messages in the UnityDataTool output like this:
66
88
67
89
```
68
-
Failed to load 'C:\....\AssetBundles.manifest'. File may be corrupted or was serialized with a newer version of Unity.
90
+
Failed to load 'C:\....\MyData.db'. File may be corrupted or was serialized with a newer version of Unity.
69
91
```
70
92
71
-
In that case it is not a serious error, because the analyze process will continue and can still produce a perfectly valid database file.
93
+
Typically these are not serious errors. The analyze process will continue, and can still produce a perfectly valid database file. However if there are many messages like this it can obscure more important or unexpected failures.
94
+
95
+
To reduce the number of these warnings, UnityDataTool automatically ignores common filenames and file paths that are found in Player, AssetBundle, Addressable or Entities builds. For example ".txt, .json, .manifest". When the `--verbose` option is passed each ignored file will be listed.
72
96
73
-
If you use an extension of other naming convention for your AssetBundles, for example ".bundle", then you can avoid those warnings using the `-p .bundle` option to ignore .manifest and other files.
97
+
If you use an extension or other naming convention for your AssetBundles, for example ".bundle", then you can avoid those warnings using the `-p .bundle` option to ignore other files.
74
98
75
-
For Player builds there is no single -p option that can catch all SerializedFiles (unless it is a compressed build generating a single data.unity3d file).
99
+
For Player builds there is no single -p option that can catch all SerializedFiles (unless it is a compressed build with a single `data.unity3d` file).
76
100
77
-
Overall it can be a good idea to avoid those errors, as noisy errors may hide more serious errors that would need your attention.
101
+
The `--no-recurse` option can reduce the volume of these warnings.
0 commit comments