Asset Lens is a dependency tracking plugin for UnityEditor that provides additional information such as the number of usage.
This plugin is based on pre-cached complementary guid map to trace which asset has dependencies to specific asset. The pain point that mainly considered with Unity is that when we delete an asset, we don't know which asset is using it.
- All assets must be serialized as force-text option in ProjectSetting/Editor
We recommend the version 2021.2.0f1
or latest
because of UI Toolkit(former UI Elements).
But plug-in still work well in lower version.
Specifically tested semantic version is :
Download with NPM (Unity Package Manager)
Replace stable version at version definition in json x.x.x
example) "com.calci.assetlens": "0.4.2"
{
"dependencies": {
"com.calci.assetlens": "x.x.x"
}
}
{
"scopedRegistries": [
{
"name": "npm",
"url": "https://registry.npmjs.org",
"scopes": [
"com.calci"
]
}
]
}
GitHub Link
https://github.com/seonghwan-dev/assetlens.git#upm
When you install plugin, indexing wizard will be shown.
- Hit the bluish
generate
button and then wait for progress bar. - When it finished, wizard will be close automatically.
- Select any asset you want to see which asset uses that.
- There is 2 options to show dependencies between assets.
4-1. hitdetail
button on top of the inspector. then editor window will be shown.
4-2. set mouse cursor to the asset in project view and hit right click and select context menu namedFind Reference In Project
.
Show Option Description
Indexes by GUID Regular Expression
: find dependencies by GUID Regex or EditorUtility.CollectDependencies.Trace scene object hierarchically
: WIP (not in feature currently)Inlcude subdirectories of Packages
: Include assets under Packages/ or not.Always open when you start a project
: if you want to see this wizard on startup again, disable this option.
- Create a cache file per a asset file, see also RefData.cs
- Detect asset changes from
AssetPostprocessor
, see also AssetLensPostprocessor.cs - Detect an attempt to delete an asset from
AssetModificationProcessor
, see also AssetLensModification.cs
- Display asset usage count in inspector.
- Find References In Project
before initialize | after initialize |
---|---|
not available | available to trace dependencies |
0.2.6
: Indexer version. This represent the which serializer indexes this asset.(UnityEngine.GameObject)
: the type of selected asset. prefabs are displayed as GameObject.Last Modified : 2021-12-22 PM 8:39:34
: last modified date time of asset. this information is not from cached data but file metadata.Dependencies
: list up assets that this asset is using.Cube 2
includes the materialMAT_Green
in MeshRenderer.Used By
: list up assets that uses selected asset. if you delete theCube 2
then the instantiated prefab inSampleScene
will be disconnected and displyed as missing.
Displays the number of other resources using the selected asset.
- Details : Open Reference Viewer as EditorWindow instantly.
- Refresh : Reserialized cached reference data asset.
- GUID : Displays the guid of selected asset. onClick events will copy guid to your clipboard.
Not stable yet, but under development.
[x] Reference View for Persistent Assets.
[ ] Reference View for Scene Objects.
[ ] Sortable Multi-Column viewer.
[ ] Dependency graph for Scene Objects.
[x] Display how many assets are related to selected asset at the top of the inspector.
[ ] Pop-up window of linked assets such as nested prefab inspector.
[x] Alert before the asset that is used by other asset will be deleted.
[ ] (Experimental) Replace reference during delete asset. (Reference Replacer)
[ ] Find the assets will be included in build
[ ] Asset bundle, Addressable, Linked assets with scenes in build setting, resources.
- Current Editor Version :
2021.2.0f1
- Fork and clone repository.
- Edit sources and commit with conventional commits (prefer Commitizen)
- Add unit test codes for new feature (Optional)
- Create PR.
Select menu in Help/Asset Lens/Enter Debug Mode
or Add an scripting define symbol DEBUG_ASSETLENS
at ProjectSettings/Player.
- Run
Tools/Asset Lens_DEV/Add New Language
to create a new localization profile. - Run
Tools/Asset Lens_DEV/Update Language profiles
to add field after editLocalize
class.
- commitizen - conventional commit log to generate changelog
must be passed test in 2019.4, 2020.3, 2021.1, 2021.2