30 lines
1.0 KiB
Lua
30 lines
1.0 KiB
Lua
|
SoundSystem = SoundSystem or {
|
||
|
SoundAssets = {};
|
||
|
}
|
||
|
|
||
|
SoundSystem.ESound = {
|
||
|
Scoll = 1,
|
||
|
Click = 2,
|
||
|
Btn = 3,
|
||
|
Kill = 4,
|
||
|
}
|
||
|
|
||
|
SoundSystem.SoundList = {
|
||
|
[SoundSystem.ESound.Scoll] = '/Game/WwiseEvent/UI/Play_UI_Item_Change.Play_UI_Item_Change',
|
||
|
[SoundSystem.ESound.Click] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Click_2_1.AK_Click_2_1'),
|
||
|
[SoundSystem.ESound.Btn] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/AK_Btn_1.AK_Btn_1'),
|
||
|
[SoundSystem.ESound.Kill] = UGCGameSystem.GetUGCResourcesFullPath('Asset/WwiseEvent/Audio_Kill_1.Audio_Kill_1')
|
||
|
}
|
||
|
|
||
|
-- 进行缓存一下
|
||
|
function SoundSystem.PlaySound(SoundType)
|
||
|
if self.SoundAssets[SoundType] == nil then
|
||
|
local AKSound = nil;
|
||
|
if SoundSystem.SoundList[SoundType] ~= nil then
|
||
|
AKSound = UE.LoadAsset_New(SoundSystem.SoundList[SoundType], true)
|
||
|
self.SoundAssets[SoundType] = AKSound;
|
||
|
end
|
||
|
end
|
||
|
UGCSoundManagerSystem.PlaySound2D(self.SoundAssets[SoundType]);
|
||
|
end
|