Skip to content

Commit

Permalink
fmod模块添加check函数检查音效/音乐是否存在
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed May 17, 2024
1 parent c89676b commit 2918cf3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions assets/fmod20221/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 2918cf3

Please sign in to comment.