Sample description
Overview
-
This sample uses " Multilingual ACB Assets " 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.
CriAssetsLocalization.ChangeLanguage(language);
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.
THIS SERVICE MAY CONTAIN TRANSLATIONS POWERED BY GOOGLE. GOOGLE DISCLAIMS ALL WARRANTIES RELATED TO THE TRANSLATIONS, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF ACCURACY, RELIABILITY, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.