Skip to content

HotFix易用性的问题 #38

@dongxue

Description

@dongxue

void OnGUI()
{
if (GUI.Button(new Rect(10, 100, 300, 150), "Hotfix"))
{
luaenv.DoString(@"
local tick = 0
xlua.hotfix(CS.HotfixTest, 'Update', function()
tick = tick + 1
if (tick % 50) == 0 then
print('<<<<<<<<Update in lua, tick = ' .. tick)
end
end)
");
}
}
根据你的范例,我想用lua重写Update方法,tick是一个类变量,我不能直接使用而要在lua中重新声明,如果我update中调用了类方法,是不是我也要在lua中重写,再进一步,如果我调用了一个类,是不是我也得在lua中重写这个类?这是否影响了hotfix的易用性,因为我只是想重写update方法。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions