Skip to content

Commit

Permalink
docs: multiple AddressableImporterSettings support
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Oct 4, 2022
1 parent b703d5f commit d41ac3f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions Documentation~/AddressableImporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/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)

Expand Down Expand Up @@ -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.
Expand All @@ -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`.
Expand Down
Binary file added Documentation~/MultipleSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Editor/AddressableImportSettingsList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit d41ac3f

Please sign in to comment.