提交 2fb73720 编写于 作者: 林新发's avatar 林新发

框架更新

上级 f8fc44b7
......@@ -31,7 +31,7 @@ public class ResConfigEditor : EditorWindow
static void Init()
{
ResConfigEditor window = (ResConfigEditor)EditorWindow.GetWindow(typeof(ResConfigEditor));
window.minSize = new Vector2(500f, 600f);
//window.minSize = new Vector2(500f, 600f);
window.Show();
s_manager = new ResConfigManager();
}
......
--region *.lua
--Date
--此文件由[BabeLua]插件自动生成
--纯lua的事件处理器
--TODO:
--纯lua的事件处理 与 调用Unity里面封装的EventDispatcher效率相差多少? 有待测试
--如果只需要在lua里面用 纯lua 的效率肯定是高
LuaEventDispatcher = LuaEventDispatcher or {}
--key:事件名称,value:事件处理方法表handles
LuaEventDispatcher.listeners = {}
local listeners = LuaEventDispatcher.listeners
--注册事件处理
function LuaEventDispatcher.RegistEvent(eventName, handle)
local handles = listeners[eventName]
if handles == nil then
handles = {}
listeners[eventName] = handles
end
table.insert(handles, handle)
end
--注销事件处理
function LuaEventDispatcher.UnRegistEvent(eventName, handle)
local handles = listeners[eventName]
if handles ~= nil then
for k, v in pairs(handles) do
if v == handle then
handles[k] = nil
return k
end
end
end
end
--触发事件
function LuaEventDispatcher.FireEvent(eventName, ...)
local handles = listeners[eventName]
if handles ~= nil then
for k, v in pairs(handles) do
v(...)
end
end
end
--endregion
fileFormatVersion: 2
guid: bd4ae9b5d48ae6f4989614ec2dc811f3
timeCreated: 1476450638
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
......@@ -21,6 +21,10 @@ public class AudioMgr
UpdateMusicVolume(m_musicVolumeFactor);
}
/// <summary>
/// 播放音效
/// </summary>
/// <param name="audioName">声音名字,需要带后缀</param>
public void PlaySound(string audioName)
{
var clip = m_cache.GetAudioClip(audioName);
......@@ -28,6 +32,12 @@ public class AudioMgr
m_channalMgr.PlaySound(clip);
}
/// <summary>
/// 播放音效
/// </summary>
/// <param name="audioName">声音名字,需要带后缀</param>
/// <param name="loop">是否循环</param>
/// <param name="fadeIn">是否渐入</param>
public void PlaySoundEx(string audioName, bool loop, bool fadeIn)
{
var clip = m_cache.GetAudioClip(audioName);
......@@ -35,6 +45,13 @@ public class AudioMgr
m_channalMgr.PlaySound(clip, loop, fadeIn);
}
/// <summary>
/// 播放音乐,比如背景音乐
/// </summary>
/// <param name="audioName">声音名字,需要带后缀</param>
/// <param name="loop">是否循环</param>
/// <param name="fadeIn">是否渐入</param>
/// <param name="pauseOther">是否停止其他背景音乐</param>
public void PlayMusic(string audioName, bool loop, bool fadeIn, bool pauseOther)
{
var cfgItem = m_cfg.GetAudioCfg(audioName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册