diff --git a/.github/Images/AddressablesAssemblyChanges.png b/.github/Images/AddressablesAssemblyChanges.png deleted file mode 100644 index e14f82c..0000000 Binary files a/.github/Images/AddressablesAssemblyChanges.png and /dev/null differ diff --git a/.github/README.md b/.github/README.md index 69e53f8..e2f4e1b 100644 --- a/.github/README.md +++ b/.github/README.md @@ -37,18 +37,6 @@ There are 5 ways to install this plugin: ![SearchResults2](Images/SearchResults2Dark.png) -## ADDRESSABLES SUPPORT - -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: - -- 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*) -- Modify the **AssetUsageDetector.Editor** Assembly Definition File as follows: - -![AddressablesAssemblyChanges](Images/AddressablesAssemblyChanges.png) - -- 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) -- Enable the "Addressables support" option in Asset Usage Detector window - ## SEARCH REFACTORING 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. diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.Editor.asmdef b/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.Editor.asmdef index 9dc8dd4..c2e6e32 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.Editor.asmdef +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetector.Editor.asmdef @@ -1,6 +1,9 @@ { "name": "AssetUsageDetector.Editor", - "references": [], + "rootNamespace": "", + "references": [ + "Unity.Addressables" + ], "includePlatforms": [ "Editor" ], @@ -10,6 +13,12 @@ "precompiledReferences": [], "autoReferenced": true, "defineConstraints": [], - "versionDefines": [], + "versionDefines": [ + { + "name": "com.unity.addressables", + "expression": "0.0.0", + "define": "ASSET_USAGE_ADDRESSABLES" + } + ], "noEngineReferences": false } \ No newline at end of file diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs index 5e46131..402f92f 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs @@ -570,7 +570,7 @@ namespace AssetUsageDetectorNamespace lazySceneSearch = WordWrappingToggleLeft( "Lazy scene search: scenes are searched in detail only when they are manually refreshed (faster search)", lazySceneSearch ); #if ASSET_USAGE_ADDRESSABLES EditorGUI.EndDisabledGroup(); - addressablesSupport = WordWrappingToggleLeft( "Addressables support (WARNING: 'Lazy scene search' will be disabled) (slower search)", addressablesSupport ); + addressablesSupport = WordWrappingToggleLeft( "Addressables support (Experimental) (WARNING: 'Lazy scene search' will be disabled) (slower search)", addressablesSupport ); #endif calculateUnusedObjects = WordWrappingToggleLeft( "Calculate unused objects", calculateUnusedObjects ); hideDuplicateRows = WordWrappingToggleLeft( "Hide duplicate rows in search results", hideDuplicateRows ); diff --git a/Plugins/AssetUsageDetector/README.txt b/Plugins/AssetUsageDetector/README.txt index 55c4be1..c14c2aa 100644 --- a/Plugins/AssetUsageDetector/README.txt +++ b/Plugins/AssetUsageDetector/README.txt @@ -8,15 +8,6 @@ E-mail: yasirkula@gmail.com 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. -### ADDRESSABLES SUPPORT -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: - -- 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) -- 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) -- Add "Unity.Addressables" assembly to "AssetUsageDetector.Editor" Assembly Definition File's "Assembly Definition References" list -- Enable the "Addressables support" option in Asset Usage Detector window - - ### HOW TO - Open "Window-Asset Usage Detector" window, configure the settings and hit "GO!". You can also right click an object and select "Search For References"