-
-
Save JohannesMP/2b6b58e5a5bce4b273c8b869aba3ead1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Called when a change in AkSoundEngine.GetCurrentLanguage() is detected | |
private void OnLanguageChange() | |
{ | |
const string bankName = "VO_SoundBank"; | |
if(_reloadBankRoutine == null) | |
{ | |
_reloadBankRoutine = StartCoroutine(ReloadBank(bankName)); | |
{ | |
} | |
private Coroutine _reloadBankRoutine; | |
private IEnumerator ReloadBank(string bankName) | |
{ | |
AkBankManager.UnloadBank(bankName); | |
yield return null; | |
bool loadIsDone = false; | |
AkBankManager.LoadBankAsync(bankName, (id, ptr, result, cookie) => | |
{ | |
loadIsDone = true; | |
}); | |
while (!loadIsDone) | |
{ | |
yield return null; | |
} | |
Debug.Log($"Bank {bankName} has been reloaded"); | |
_reloadBankRoutine = null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment