Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
林新发
UnityXFramework
提交
2fb73720
U
UnityXFramework
项目概览
林新发
/
UnityXFramework
通知
1399
Star
143
Fork
77
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
U
UnityXFramework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2fb73720
编写于
11月 11, 2021
作者:
林新发
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
框架更新
上级
f8fc44b7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
65 deletion
+18
-65
Assets/Editor/ResConfig/ResConfigEditor.cs
Assets/Editor/ResConfig/ResConfigEditor.cs
+1
-1
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua
+0
-56
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua.meta
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua.meta
+0
-8
Assets/Scripts/Framework/Audio/AudioMgr.cs
Assets/Scripts/Framework/Audio/AudioMgr.cs
+17
-0
未找到文件。
Assets/Editor/ResConfig/ResConfigEditor.cs
浏览文件 @
2fb73720
...
...
@@ -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
();
}
...
...
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua
已删除
100644 → 0
浏览文件 @
f8fc44b7
--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
Assets/LuaFramework/Lua/Lib/LuaEventDispatcher.lua.meta
已删除
100644 → 0
浏览文件 @
f8fc44b7
fileFormatVersion: 2
guid: bd4ae9b5d48ae6f4989614ec2dc811f3
timeCreated: 1476450638
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Framework/Audio/AudioMgr.cs
浏览文件 @
2fb73720
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录