TaoOneOne / xLua_FairyGui_Demo

Other
21 stars 7 forks source link

fgui.extension_class 有试过吗 #1

Open li5414 opened 5 years ago

li5414 commented 5 years ago

你好,首先感谢你的尝试和分享! 我照你的教程试了,基础的UI是没问题了,但是扩展报错了 LuaUIHelper里面的方法ConnectLua

if (extendFunction!=null)
{
    gcom.data = null;
    _peerTable = extendFunction.Func<GComponent,LuaTable>(gcom);
}

_peerTable返回是空的

local v = fgui.extension_class(GButton)
function v:ctor()
    self:init()
end
function v:init()
    self.bg = self:GetChild("bg");
end

在lua里面调用self 说是没这个属性 LuaException: c# exception:XLua.LuaException: c# exception:XLua.LuaException: View/LoginUI/ServerItem:3: attempt to call a nil value (method 'init') 断点看 TIM截图20190824152651 self 指向的是GLuaButton

LazyPlanet commented 3 years ago

@li5414 他这个东西跑不起来的,xlua本身是不支持这种写法https://ask.fairygui.com/?/question/7073

TaoOneOne commented 3 years ago

-- tolua.setpeer(ins, t) xutil.state(ins, t)