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
Docs: Addressables example for local-to-remote explicit dependencies
Add SQLite example query and narrative for finding explicit addressables in
locally classified bundles that depend on explicit addressables in remote
bundles, using build layout JSON from analyze.
Update addressables-build-reports schema notes and cross-link to the example.
Made-with: Cursor
You can analyze a directory with both asset bundles (*.bundle) and json files (*.json) at the same time.
112
112
113
+
### Cross-group dependencies (local → remote)
114
+
115
+
To find explicit addressable assets whose bundle is classified as **local** (for example by `load_path`) but that depend on explicit addressables in **remote** bundles, see [Example: Local Addressable groups depending on remote groups](analyze-examples.md#example-local-addressable-groups-depending-on-remote-groups) in analyze-examples.md.
116
+
113
117
### Sample Queries
114
118
115
119
Once the data is in the database, you can run queries to analyze your Addressables build:
@@ -118,12 +122,13 @@ Once the data is in the database, you can run queries to analyze your Addressabl
118
122
#### Find all implicit assets for an explicit asset
119
123
```sql
120
124
-- Find implicitly included assets for a given explicit asset id
See [buildreport.md](buildreport.md) for information about using analyze to look at BuildReport files.
70
70
71
+
## Example: Local Addressable groups depending on remote groups
72
+
73
+
Addressables build layout JSON (for example under `Library\com.unity.addressables\BuildReports\`) records which **explicit** addressable assets reference other **explicit** addressables, including references that cross bundles and groups. That information is stored in SQLite when you run **analyze** on those reports; see [addressables-build-reports.md](addressables-build-reports.md) for schema overview.
74
+
75
+
UnityDataTools does **not** store a boolean “local” or “remote” flag. In practice, each bundle row has a **`load_path`** string from the build report (table `addressables_build_bundles`). You can classify bundles for a given project by testing that string—for example:
76
+
77
+
***Remote bundle:**`load_path` starts with `https://` or `http://` (typical for remote profiles).
78
+
***Local bundle:** not matched by the above (often paths containing `{UnityEngine.AddressableAssets.Addressables.RuntimePath}` or similar). You may refine this for your naming or add conditions such as non-empty `load_path` if you need to exclude odd rows.
79
+
80
+
Reference edges you care about for “local asset depends on remote explicit addressable” come from two tables (both keyed by `build_id`):
81
+
82
+
*`addressables_build_explicit_asset_externally_referenced_assets` — from the layout’s **ExternallyReferencedAssets** list.
83
+
*`addressables_build_explicit_asset_internal_referenced_explicit_assets` — from **InternalReferencedExplicitAssets**.
84
+
85
+
Together, these cover explicit-to-explicit dependencies the report encodes (for example prefabs in a local group referencing materials in a remote group). Dependencies that only appear as non-addressable “other” assets are in `addressables_build_explicit_asset_internal_referenced_other_assets` and `addressables_build_data_from_other_assets`; use those if you need implicit dependency closure.
86
+
87
+
**1. Produce a database from your build reports** (adjust paths; on Windows use backslashes or quoted paths):
**2. Find the `build_id`** for the report you care about (often the latest row):
94
+
95
+
```
96
+
sqlite3 addressables_analysis.db "SELECT id, name, start_time FROM addressables_builds ORDER BY id DESC LIMIT 5;"
97
+
```
98
+
99
+
Use that `id` as `:build_id` in the query below.
100
+
101
+
**3. List explicit assets in a local bundle that reference an explicit asset in a remote bundle**
102
+
103
+
The following uses a `UNION ALL` of the two explicit-explicit edge tables. Replace `1` with your `build_id`. Bundle `load_path` values are joined only so the `WHERE` clause can classify local vs remote bundles; they are not selected in the result. Column aliases **`local_*`** refer to the asset in the locally classified bundle (the referencing side), and **`remote_*`** to the depended-on asset in the remotely classified bundle. The **`dependency_type`** column uses short labels aligned with typical Addressables UI wording: **`explicit`** for edges from **ExternallyReferencedAssets**, and **`implicit`** for edges from **InternalReferencedExplicitAssets**. In both cases the dependency is still between **explicit addressables** in the build layout; non-addressable “other” assets are modeled separately in `addressables_build_explicit_asset_internal_referenced_other_assets` / `addressables_build_data_from_other_assets`.
104
+
105
+
```sql
106
+
SELECT
107
+
'explicit'AS dependency_type,
108
+
src.addressable_nameAS local_address,
109
+
src.asset_pathAS local_asset_path,
110
+
sg.nameAS local_group_name,
111
+
tgt.addressable_nameAS remote_address,
112
+
tgt.asset_pathAS remote_asset_path,
113
+
tg.nameAS remote_group_name
114
+
FROM addressables_build_explicit_asset_externally_referenced_assets x
0 commit comments