SFX.playSample支持同时播放多个采样(两种参数格式)
This commit is contained in:
@@ -79,11 +79,21 @@ function SFX.setStereo(v)
|
|||||||
stereo=v
|
stereo=v
|
||||||
end
|
end
|
||||||
|
|
||||||
function SFX.playSample(pack,tune,vol)
|
function SFX.playSample(pack,...)
|
||||||
if type(tune)=='string'then
|
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
|
tune=_getTuneHeight(tune)-packSetting[pack].base+1
|
||||||
SFX.play(pack..tune,vol)
|
SFX.play(pack..tune,vol)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function SFX.play(name,vol,pos)
|
function SFX.play(name,vol,pos)
|
||||||
if volume==0 or vol==0 then return end
|
if volume==0 or vol==0 then return end
|
||||||
|
|||||||
Reference in New Issue
Block a user