BGM模块新增setChange方法可以设置切换BGM的时候会触发的事件
切换BGM时弹出BGM名称
This commit is contained in:
@@ -5,12 +5,16 @@ local BGM={
|
||||
play=NULL,
|
||||
freshVolume=NULL,
|
||||
stop=NULL,
|
||||
onChange=NULL,
|
||||
--nowPlay=[str:playing ID]
|
||||
--playing=[src:playing SRC]
|
||||
}
|
||||
function BGM.setDefault(bgm)
|
||||
BGM.default=bgm
|
||||
end
|
||||
function BGM.setChange(func)
|
||||
BGM.onChange=func
|
||||
end
|
||||
function BGM.init(list)
|
||||
BGM.init=nil
|
||||
local Sources={}
|
||||
@@ -85,6 +89,7 @@ function BGM.init(list)
|
||||
BGM.nowPlay=name
|
||||
BGM.playing=Sources[name]
|
||||
BGM.playing:play()
|
||||
BGM.onChange(name)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user