0.4.7 • Published 2 years ago
com.calci.assetlens v0.4.7
Asset Lens
About Asset Lens
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.
Requirements
- All assets must be serialized as force-text option in ProjectSetting/Editor
Compatibility
Installation
Unity Package Manager (NPM)
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"
]
}
]
}
OpenUPM
openupm add com.calci.assetlens
QuickStart
- Open Asset Lens Setting in
Edit/Project Settings...
- Hit the button
Initialize
to index all assets in project. - Configure the settings for convenience.
- Select an asset you want to know which asset references it and run
Find References In Project
context menu.
Fundamentals
- 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
Features
- Display asset usage count in inspector.
- Find References In Project
Reference Viewer Window
before initialize | after initialize |
---|---|
not available | available to trace dependencies |
Inspector Indicator
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.
Roadmap
Not stable yet, but under development.
Reference Viewer
- Multi Column Viewer (Sortable)
- Scene Object Reference Graph
Safe Delete
- Alert before the asset that is used by other asset will be deleted.
- Replace reference during delete asset. (Reference Replacer)
Inspector Lens
- Display how many assets are related to selected asset at the top of the inspector.
Build Lens
- Find the assets will be included in build
- Asset bundle, Addressable, Linked assets with scenes in build setting, resources.
Contributes
- 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.
Developer mode
Select menu in Help/Asset Lens/Enter Debug Mode
or Add an scripting define symbol DEBUG_ASSETLENS
at ProjectSettings/Player.
Edit Languages
- 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.
Requirements
- commitizen - conventional commit log to generate changelog
Tests
must be passed test in 2019.4, 2020.3, 2021.1, 2021.2