52 lines
1.2 KiB
Lua
52 lines
1.2 KiB
Lua
--格式:one csharp class, one lua table
|
||
--更多操作:https://github.com/Tencent/xLua/blob/master/Assets/XLua/Doc/faq.md
|
||
--https://github.com/Tencent/xLua/blob/master/Assets/XLua/Doc/hotfix.md
|
||
local Hotfix_EffectHelper = {}
|
||
|
||
-------------------配置--------------------
|
||
-- 热更csharp类
|
||
local CSClass = CS.BF.EffectHelper
|
||
|
||
-- 配置对应类型的函数,cs/lua两端的函数名保持一致
|
||
-- 重载函数需在热更lua函数中做参数判断
|
||
-- 配置中'_ex'指可以在热更函数中再次调用csharp对应的函数
|
||
local FuncCfg =
|
||
{
|
||
-- public = {
|
||
|
||
-- },
|
||
public_ex = {
|
||
"Play",
|
||
},
|
||
-- private = {
|
||
|
||
-- },
|
||
-- private_ex = {
|
||
|
||
-- },
|
||
-- ienumerator = {
|
||
|
||
-- },
|
||
-- ienumerator_private = {
|
||
|
||
-- }
|
||
}
|
||
|
||
----------------------------------------------
|
||
|
||
------------------具体实现----------------------
|
||
function Hotfix_EffectHelper:Play(gameobject)
|
||
Logger.log("lua2csharp hotfix %s", gameobject.name)
|
||
self:Play(gameobject) --self指的是对应的c#实例
|
||
end
|
||
|
||
----------------------------------------------------
|
||
|
||
----------------------执行---------------------------
|
||
function Hotfix_EffectHelper:__execute()
|
||
HotfixCore.execute(self, CSClass, FuncCfg)
|
||
end
|
||
|
||
Hotfix_EffectHelper:__execute()
|
||
----------------------------------------------------
|