Merge pull request #320 from argonui/soundcubeapi
SoundCubeApi: fixed scoping
This commit is contained in:
commit
d5863c5b3a
@ -1,5 +1,6 @@
|
|||||||
do
|
do
|
||||||
local SoundCubeApi = {}
|
local SoundCubeApi = {}
|
||||||
|
local internal = {}
|
||||||
|
|
||||||
-- this table links the name of a trigger effect to its index
|
-- this table links the name of a trigger effect to its index
|
||||||
local soundIndices = {
|
local soundIndices = {
|
||||||
@ -8,14 +9,14 @@ do
|
|||||||
["Dark Souls"] = 2
|
["Dark Souls"] = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
function playTriggerEffect(index)
|
internal.playTriggerEffect = function(index)
|
||||||
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index)
|
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- plays the by name requested sound
|
-- plays the by name requested sound
|
||||||
---@param soundName String Name of the sound to play
|
---@param soundName String Name of the sound to play
|
||||||
SoundCubeApi.playSoundByName = function(soundName)
|
SoundCubeApi.playSoundByName = function(soundName)
|
||||||
playTriggerEffect(soundIndices[soundName])
|
internal.playTriggerEffect(soundIndices[soundName])
|
||||||
end
|
end
|
||||||
|
|
||||||
return SoundCubeApi
|
return SoundCubeApi
|
||||||
|
Loading…
Reference in New Issue
Block a user