SFX.playSample支持同时播放多个采样(两种参数格式)

This commit is contained in:
MrZ626
2021-10-21 15:51:51 +08:00
parent 59c63da36f
commit 222c1b5bba

View File

@@ -79,10 +79,20 @@ function SFX.setStereo(v)
stereo=v
end
function SFX.playSample(pack,tune,vol)
if type(tune)=='string'then
tune=_getTuneHeight(tune)-packSetting[pack].base+1
SFX.play(pack..tune,vol)
function SFX.playSample(pack,...)
if ... then
local arg={...}
local vol
if type(arg[#arg])=='number'then vol=rem(arg)end
for i=1,#arg do
if type(arg[i])=='number'then
vol=arg[i]
else
local tune=arg[i]
tune=_getTuneHeight(tune)-packSetting[pack].base+1
SFX.play(pack..tune,vol)
end
end
end
end
function SFX.play(name,vol,pos)