diff --git a/Documentation~/AddressableImporter.md b/Documentation~/AddressableImporter.md index d10b4c0..8daf502 100644 --- a/Documentation~/AddressableImporter.md +++ b/Documentation~/AddressableImporter.md @@ -9,16 +9,21 @@ Table of Contents - [Label Replacement](#label-replacement) - [Quick Assets Re-import](#quick-assets-re-import) - [About Prefab Mode](#about-prefab-mode) +- [Multiple AddressableImportSettings Support](#multiple-addressableimportsettings-support) - [Odin Inspector Support](#odin-inspector-support) - [Contributor Notice](#contributor-notice) ## Setup the Importer -You should create a single AddressableImportSettings file located at `Assets/AddressableAssetsData/AddressableImportSettings.asset`. To create it, go to `Assets/AddressableAssetsData` folder, right click in your project window and choose `Create > Addressables > Import Settings`. +Make sure you have run the Unity Addressables's [Create Addressables Settings](https://docs.unity3d.com/Packages/com.unity.addressables@1.20/manual/AddressableAssetsGettingStarted.html) command to create a folder called `AddressableAssetsData`, in which it stores settings files and other assets for the Addressables system. + +Then go to `Assets/AddressableAssetsData` folder, right click in your project window and run the `Create > Addressables > Import Settings` command to create an AddressableImportSettings file at `AddressableImportSettings.asset`, and an AddressableImportSettingsList file at `AddressableImportSettingsList.asset`. ![AddressableImportSettings Create](AddressableImportSettings-Create.png) -Once the settings file selected, you can edit rules in the inspector window. Then click the `File > Save Project` to apply the changes. +AddressableImportSettings is the place to add/edit import rules. You can have more than one AddressableImportSettings and get them organized in a single AddressableImportSettingsList. But for projects at a smaller scale, one AddressableImportSettings is good enough. + +Once the settings file selected, you can edit rules in the inspector window. Then click the `Save` button to apply the changes. ![AddressableImportSettings Inspector](AddressableImportSettings-Insepctor.png) @@ -127,6 +132,16 @@ AddressableImporter.FolderImporter.ReimportFolders(new string[] { "Assets" }); When both prefab mode (the preview scene for editing a prefab) and the autosave feature are enabled, every modification will cause the asset to be saved and trigger the importer, leads to slow response. For performance reasons, the importer will ignore the current editing asset. +## Multiple AddressableImportSettings Support + +Multiple AddressableImportSettings are supported to help projects at a larger scale get better organized. The ordering of multiple AddressableImportSettings is prioritized by a single AddressableImportSettingsList. + +The newly created AddressableImportSettings will be added to the AddressableImportSettingsList automatically. The copied AddressableImportSettings requires to be linked manually, or click the `Rebuild Settings List` button to load all AddressableImportSettings files in the project. + +![Multiple Settings](MultipleSettings.png) + +An AddressableImportSettings can be toggled by its `Rules Enabled` field, a useful feature to help you test multiple AddressableImportSettings. + ## Odin Inspector Support Since v0.9.0, the importer supports [Odin inspector](https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1011lJJH) (affiliates) to optimize the user experience. Odin is a paid tool to boost editor plugin development. The integration allows filter or order importer rules easier. The Odin support is optional. To enable it, just install the Odin library. @@ -141,8 +156,6 @@ If you no longer use Odin, please remove the flags above, otherwise Unity will r error CS0246: The type or namespace name 'ISearchFilterable' could not be found (are you missing a using directive or an assembly reference?) ``` -Notice that the Odin support may be moved to an additional plugin or discontinued if the importer's UX gets improved in the future. - ## Contributor Notice To enable unit tests for this package, add the package name `com.littlebigfun.addressable-importer` into the `testables` fields of `Packages/manifest.json`. diff --git a/Documentation~/MultipleSettings.png b/Documentation~/MultipleSettings.png new file mode 100644 index 0000000..cc0a4c3 Binary files /dev/null and b/Documentation~/MultipleSettings.png differ diff --git a/Editor/AddressableImportSettingsList.cs b/Editor/AddressableImportSettingsList.cs index c43d4c2..bcd8545 100644 --- a/Editor/AddressableImportSettingsList.cs +++ b/Editor/AddressableImportSettingsList.cs @@ -88,6 +88,6 @@ public void RebuildSettingsList() [ButtonMethod] public void Documentation() { - Application.OpenURL("https://github.com/favoyang/unity-addressable-importer/blob/master/Documentation~/AddressableImporter.md"); + Application.OpenURL("https://github.com/favoyang/unity-addressable-importer/blob/master/Documentation~/AddressableImporter.md#multiple-addressableimportsettings-support"); } }