提交 0f3672ed 编写于 作者: J johnche(车雄生)

Merge branch 'master' of https://github.com/Tencent/xLua

......@@ -618,6 +618,10 @@ namespace CSObjectWrapEditor
GenOne(null, (type, type_info) =>
{
var type2fields = luaenv.NewTable();
foreach(var _type in types)
type2fields.Set(_type, _type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(x => !isMemberInBlackList(x)).ToArray());
type_info.Set("type2fields", type2fields);
type_info.Set("types", types.ToList());
}, templateRef.LuaEnumWrap, textWriter);
......
......@@ -19,7 +19,7 @@ namespace XLua.CSObjectWrap
{
using Utils = XLua.Utils;
<%ForEachCsList(types, function(type)
local fields = type:GetFields(enum_or_op(CS.System.Reflection.BindingFlags.Public, CS.System.Reflection.BindingFlags.Static))
local fields = type2fields and type2fields[type] or type:GetFields(enum_or_op(CS.System.Reflection.BindingFlags.Public, CS.System.Reflection.BindingFlags.Static))
%>
public class <%=CSVariableName(type)%>Wrap
{
......
......@@ -20,7 +20,7 @@ namespace XLua
public partial class ObjectTranslator
{
<%ForEachCsList(types, function(type)
local fields = type:GetFields(enum_or_op(CS.System.Reflection.BindingFlags.Public, CS.System.Reflection.BindingFlags.Static))
local fields = type2fields and type2fields[type] or type:GetFields(enum_or_op(CS.System.Reflection.BindingFlags.Public, CS.System.Reflection.BindingFlags.Static))
local v_type_name = CSVariableName(type)
%>
public void __Register<%=v_type_name%>(RealStatePtr L)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册