Skip to content

Commit 8441e47

Browse files
committed
Addressables support no longer requires manual modifications
1 parent d57a707 commit 8441e47

5 files changed

Lines changed: 12 additions & 24 deletions

File tree

-20.1 KB
Binary file not shown.

.github/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ There are 5 ways to install this plugin:
3737

3838
![SearchResults2](Images/SearchResults2Dark.png)
3939

40-
## ADDRESSABLES SUPPORT
41-
42-
This plugin has experimental support for *Addressables* package. However, the search may take significantly longer to finish when Addressables are searched. Some manual modifications are needed to enable Addressables support:
43-
44-
- The plugin mustn't be installed as a package, i.e. it must reside inside the *Assets* folder and not the *Packages* folder (it can reside inside a subfolder of Assets like *Assets/Plugins*)
45-
- Modify the **AssetUsageDetector.Editor** Assembly Definition File as follows:
46-
47-
![AddressablesAssemblyChanges](Images/AddressablesAssemblyChanges.png)
48-
49-
- If *Version Defines* isn't present (on older Unity versions), manually add `ASSET_USAGE_ADDRESSABLES` compiler directive to **Player Settings/Scripting Define Symbols** (these symbols are platform specific, so if you change the active platform later, you'll have to add the compiler directive again)
50-
- Enable the "Addressables support" option in Asset Usage Detector window
51-
5240
## SEARCH REFACTORING
5341

5442
While searching for references using the Scripting API, it's possible to get notified of the found references *during* the search (some references like *Assembly Definition File* references or *Shader Graph* references aren't supported) and in most cases, refactor them (e.g. changing all usages of a searched object with something else or *null*). Disabling *Lazy Scene Search* is recommended while using this feature and it's advised to backup your project beforehand.
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"name": "AssetUsageDetector.Editor",
3-
"references": [],
3+
"rootNamespace": "",
4+
"references": [
5+
"Unity.Addressables"
6+
],
47
"includePlatforms": [
58
"Editor"
69
],
@@ -10,6 +13,12 @@
1013
"precompiledReferences": [],
1114
"autoReferenced": true,
1215
"defineConstraints": [],
13-
"versionDefines": [],
16+
"versionDefines": [
17+
{
18+
"name": "com.unity.addressables",
19+
"expression": "0.0.0",
20+
"define": "ASSET_USAGE_ADDRESSABLES"
21+
}
22+
],
1423
"noEngineReferences": false
1524
}

Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private void OnGUI()
570570
lazySceneSearch = WordWrappingToggleLeft( "Lazy scene search: scenes are searched in detail only when they are manually refreshed (faster search)", lazySceneSearch );
571571
#if ASSET_USAGE_ADDRESSABLES
572572
EditorGUI.EndDisabledGroup();
573-
addressablesSupport = WordWrappingToggleLeft( "Addressables support (WARNING: 'Lazy scene search' will be disabled) (slower search)", addressablesSupport );
573+
addressablesSupport = WordWrappingToggleLeft( "Addressables support (Experimental) (WARNING: 'Lazy scene search' will be disabled) (slower search)", addressablesSupport );
574574
#endif
575575
calculateUnusedObjects = WordWrappingToggleLeft( "Calculate unused objects", calculateUnusedObjects );
576576
hideDuplicateRows = WordWrappingToggleLeft( "Hide duplicate rows in search results", hideDuplicateRows );

Plugins/AssetUsageDetector/README.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ E-mail: yasirkula@gmail.com
88
This tool helps you find usages of the selected asset(s) and/or scene object(s), i.e. lists the objects that refer to them.
99

1010

11-
### ADDRESSABLES SUPPORT
12-
This plugin has experimental support for Addressables package. However, the search may take significantly longer to finish when Addressables are searched. Some manual modifications are needed to enable Addressables support:
13-
14-
- The plugin mustn't be installed as a package, i.e. it must reside inside the Assets folder and not the Packages folder (it can reside inside a subfolder of Assets like Assets/Plugins)
15-
- Add ASSET_USAGE_ADDRESSABLES compiler directive to "Player Settings/Scripting Define Symbols" (these symbols are platform specific, so if you change the active platform later, you'll have to add the compiler directive again)
16-
- Add "Unity.Addressables" assembly to "AssetUsageDetector.Editor" Assembly Definition File's "Assembly Definition References" list
17-
- Enable the "Addressables support" option in Asset Usage Detector window
18-
19-
2011
### HOW TO
2112
- Open "Window-Asset Usage Detector" window, configure the settings and hit "GO!". You can also right click an object and select "Search For References"
2213

0 commit comments

Comments
 (0)