这样完全只要关系逻辑了,别的都秒杀,只是代码出错了,多半要用肉眼看,,,
再有就是用luabind class的细节,还不了解
CTestClass =
{
m_TestVal = 0,
m_funcTest = nul
}
function CTestClass:SetValue(v)
self.m_TestVal = v;
end
function CTestClass:TestShow()
print(self.m_TestVal);
end
function CTestClass:SetTestFunc(func)
self.m_funcTest = func;
end
function CTestClass:CallTestFunc()
self.m_funcTest();
end
function CTestClass:TestHandleFunc(msg)
print(msg)
end
t1 = CTestClass;
t1:SetValue(123321);
t1:TestShow();
t1:SetTestFunc(
function ()
t1:TestHandleFunc('TestHandleFunc')
end);
t1:CallTestFunc();