It is a tool that allows you to set specific import settings to the textures inside your project that match a certain rule which helps reduce build sizes and load times. Using this tool you can configure rules that can be applied automatically or manually to entire folders if need be.
Once you've imported the SDK you can find the tool in the Trail window entry as seen below:
Click on the
Texture Import Settings Applier option and the below window will appear:
Click on the
Create Texture Import Settings Applier; this creates an asset in the Trail SDK folder that will contain all your different rules.
The next step is to create a rule to apply to your textures. Click on the
Add new applier rule:
Now that a new rule is created, you can now modify the import settings in a single location (instead of hunting for them everywhere). You should be familiar with most of these settings -- they are Unity's import settings. However, under "Advanced" there is a new option that allows you to scale your source assets which in turn enables you to use Crunch Compression on textures.
Scale source file to closest multiple of 4
This option modifies the source files (assets) directly and normally would break all references to the affected asset. The way the Texture Import Settings Applier tool modifies the asset is by modifying it from Single to Multiple, This forces Unity to "technically" create a new copy of the source file which in turn breaks all references to the asset. To avoid this from happening you must click on "Build Texture References Database" before you apply your rules that use this option.
The last thing that is not part of Unity's default import settings is the "Regular Expression Patterns" section. This allows you to pick specific assets only in your projects to apply the rule to. The
Test regular expressions button will print the result of your typed in expression to help you debug and confirm the expression. Below you can find an example of a regular expression that limits the rule to only assets within the "Assets/Sprites" folder.
After you've set all the options as you see fit, you'll need to click on
Apply. In case source files will be modified you will receive a message similar to the below:
If you haven't built the texture references database, it is recommended you do so now. If you did that already, then you can click
Apply anyway and this the rule will be applied immediately to your projects. Depending on the number of assets that you have and the rule's expression, this may take a few minutes.
Here is an example asset before the rule was applies:
Here is the same asset after the rule was applied:
Updated over 1 year ago