module("EseAsyncBankLoader", package.seeall) -- Behavior function OnBankTrigger(selfID, strm) local key = BehaviorAPI.GetNextPropertyKey(selfID, "BanksToLoad", "") while key ~= "" do local soundBank = BehaviorAPI.GetProperty(selfID, "BanksToLoad", key) BehaviorAPI.LogMessage(2, "AsyncBankLoader: Loading "..tostring(soundBank).." sound bank.") epgmWwise.LoadBankAsync( tostring(soundBank), selfID, "OnCallback") key = BehaviorAPI.GetNextPropertyKey(selfID, "BanksToLoad", key) end key = BehaviorAPI.GetNextPropertyKey(selfID, "BanksToUnload", "") while key ~= "" do local soundBank = BehaviorAPI.GetProperty(selfID, "BanksToUnload", key) BehaviorAPI.LogMessage(2, "AsyncBankLoader: Unloading "..tostring(soundBank).." sound bank.") epgmWwise.UnloadBankAsync(tostring(soundBank), selfID, "OnCallback") key = BehaviorAPI.GetNextPropertyKey(selfID, "BanksToUnload", key) end end