From 2918cf33938ffb38c4372e6f8144955bf5d9c68f Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 18 May 2024 04:42:28 +0800 Subject: [PATCH] =?UTF-8?q?fmod=E6=A8=A1=E5=9D=97=E6=B7=BB=E5=8A=A0check?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=A3=80=E6=9F=A5=E9=9F=B3=E6=95=88/?= =?UTF-8?q?=E9=9F=B3=E4=B9=90=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/fmod20221/init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/assets/fmod20221/init.lua b/assets/fmod20221/init.lua index 5cf4483c..9758ecb0 100644 --- a/assets/fmod20221/init.lua +++ b/assets/fmod20221/init.lua @@ -125,6 +125,13 @@ end ---@type {desc:FMOD.Studio.EventDescription?, event:FMOD.Studio.EventInstance?}? local playing=nil +---Check if a music name exists +---@param name string +---@return boolean +function M.music.check(name) + return musicLib[name]~=nil +end + ---@param name string ---@param args? {instant?:boolean, volume?:number, pitch?:number, tune?:number, fine?:number, pos?:number[], param?:table} ---@return FMOD.Studio.EventInstance? @@ -242,6 +249,13 @@ function M.effect.setVolume(v,instant) studio:setParameterByName('EffectVolume',M.mainVolume*M.effectVolume,instant==true) end +---Check if an effect name exists +---@param name string +---@return boolean +function M.effect.check(name) + return effectLib[name]~=nil +end + ---priority: pitch>tune>fine --- ---pos:{x,y,z}