From 222c1b5bba3179bb0adda02c17e0cb516ea04772 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 21 Oct 2021 15:51:51 +0800 Subject: [PATCH] =?UTF-8?q?SFX.playSample=E6=94=AF=E6=8C=81=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E6=92=AD=E6=94=BE=E5=A4=9A=E4=B8=AA=E9=87=87=E6=A0=B7?= =?UTF-8?q?=EF=BC=88=E4=B8=A4=E7=A7=8D=E5=8F=82=E6=95=B0=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/sfx.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Zframework/sfx.lua b/Zframework/sfx.lua index acbc759e..dc8bdff3 100644 --- a/Zframework/sfx.lua +++ b/Zframework/sfx.lua @@ -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)