CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[Asset Support] Multilingual ACB Assets

Sample description

Overview

cri4u_samples_addon_asset03_multilingual.png

This sample uses " \ref addon4u_assetsupport_assets_adx_multilingual " to showcase basic language-based features.
Press the button in the window to play back the dialogue in the selected language.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Asset Support Sample
Location /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Scenes/
Scene file Scene_03_Multilingual.unity
Multilingual ACB Asset /cri/unity/samples/UnityProject/Assets/CriAssetSamples/Data/Multilingual/LocalizedACB.localizedacb


Description of the program

This sample uses a minimal amount of code to switch the language using the multilingual ACB Assets.

Switching Languages

CriAssetsLocalization.ChangeLanguage is called when an event is triggered from the UI.

// Switch by specifying the language name present in the asset
CriAssetsLocalization.ChangeLanguage(language);
// Reload to reflect the Language settings
CriAtomAssetsLoader.ReleaseCueSheet(acbAsset);
CriAtomAssetsLoader.AddCueSheet(acbAsset);

The change of language will only be reflected once the multilingual ACB Asset is reloaded.
Therefore, this sample unloads and reloads the ACB in order to immediately switch to the new language.
If a sound is already playing, it will be stopped.

Audio playback

Multilingual ACB assets can be treated in the same way as regular ACB assets generated by importing Non-Asset CRI data. This sample plays back the audio in the same way as [Asset Support] Atom Basic Playback .
It assigns a multilingual ACB asset to the CriAtomSourceForAsset instead of regular ACB asset.