Unity tolua 绑定自定义类
一.首先在CustomSetting中添加需要添加的类//在这里添加你要导出注册到lua的类型列表public static BindType[] customTypeList ={ //------------------------为例子导出----------------------- ... //自定义类 _GT(typeof(GSUITool)), _GT(typeof(GSUIData)), ...}二. 点击Generate All生成wrap文件(/Source/Generate/)同时会自动在Luabinder中注册
三. 修改Luastate载入自定义类
void OpenBaseLibs(){ BeginModule(null); ... BeginModule ("gs"); GSUIToolWrap.Register (this); GSUIDataWrap.Register (this); EndModule(); EndModule(); //end global ...}四. 在lua中调用gs.GSUITool
页:
[1]