CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
How to use CRI Addressables [Below 0.7.00]
Attention
The usage method described in this section is an option that is left in place to maintain compatibility.
If you are using CRI Addressables 0.7.00 or later, please consider migrating by referring to the following.
  • " \ref addon4u_assetsupport_addressables_usage_usecribuildscript "

Setting Deploy Type

Please specify "Addressables" as the DeployType of CRI asset managed by Addressables.
At this time, you can specify Remote or Local for the Group on the Inspector.
  • " \ref addon4u_assetsupport_assets_import_deploy_type "
addon4u_assetsupport_addressables_deploygroup.png
Anchor asset and CriData groups that are used internally by CRI Addressables are generated during the import process.
Please check " \subpage addon4u_assetsupport_addressables_structure " for details.
When building a bundle, the actual data of the CRI asset will be placed in the deployment destination according to the Group.
Set the build/load path corresponding to each group using CriAddressablesSetting.

Settings for each project

When using the features of the CRI Addressables, a CriAddressablesSetting Asset is added to the project.
Its default location is "Assets/CriData/Settings", but it can be moved to another folder.
Properties set to the CriAddressablesSetting Asset can be used by the CRI Addressables.

If the CriAddressablesSetting Asset exists, its settings can be edited in the Project Settings window.
addon4u_assetsupport_addressables_setting.png


Local This is the pair of build/load paths for CRI assets for which the "Addressables" Group is set to Remote.
Select one of the variables set in the Addressables Profile.
Remote This is the pair of build/load paths for CRI assets for which the "Addressables" Group is set to Local.
Select one of the variables set in the Addressables Profile.
Append Guid To Anchor If enabled, a GUID will be attached to the Anchor Asset name.
Anchor Folder Path The path to generate the "Anchor Asset".
Deploy Folder Suffix A suffix for the path, indicating where to put the Non-Asset CRI data for Addressables.


Note that "Local" and "Remote" refer to two different default target groups.
For information about how to add or edit a target group, refer to CRI Addressables: Target Group .
"Append Guid To Anchor" is enabled by default. Note that when it is disabled, it will be difficult to handle CRI Assets with identical names located in different folders.
It is therefore recommended to enable this setting if any CRI Assets share the same names (including the file extension) in the project.

Bundle building

When building the Addressables bundle, the Non-Asset CRI data corresponding to the CRI Asset will be located according to the build path specified via CriAddressablesSetting.
The actual number of files stored is output to the console.

Modifying the catalog information

To properly run the acquired download size API such as Addressables.GetDownloadSizeAsync , you need to call CriWare.Assets.CriAddressables.ModifyLocators after finishing loading all the content catalogs.

Remarks:
Since CRIWARE Non-Asset data is handled via the CRI Addressables using the mechanism for an AssetBundle, there can be a mismatch with the content written in the catalog of the Addressables.
More specifically, the "Size of the AssetBundle" indicates the size of the resources, so the actual size of the CRIWARE Non-Asset data will not be reflected.
As a result, the download size returned by the API - and based on the contents of the catalog - will be incorrect.
To avoid this issue, it is necessary to update the content of the catalog after loading it.
By calling CriWare.Assets.CriAddressables.ModifyLocators, it is possible to modify the current CRI Assets-related location information registered in the Addressables.

Loading the assets

The assets can be loaded using the normal Addressables API (with or without CRI Assets being present).
When loading scenes or assets that have CRI Assets dependencies, or directly loading a CRI Asset via the Addressables API, any related Non-Asset CRI data is downloaded into the cache folder.
After using Addressables API, the CRI data will also be included in the cache.

Attention
The CRI assets managed via CRI Addressables cannot be loaded using direct references from the built-in scene.