private string GetFunName(CSToLuaPropertyType pType) { if (pType == CSToLuaPropertyType.Get) { return(string.Format("GetProperty_{0}", propertyInfo.Name)); } if (pType == CSToLuaPropertyType.Set) { return(string.Format("SetProperty_{0}", propertyInfo.Name)); } return(""); }
public CSToLuaPropertyRegister(CSToLuaClassRegister cr, PropertyInfo pi) { classRegister = cr; propertyInfo = pi; MethodInfo getMethod = propertyInfo.GetGetMethod(); MethodInfo setMethod = propertyInfo.GetSetMethod(); if (propertyInfo.CanRead && propertyInfo.CanWrite) { if (setMethod != null && getMethod != null && setMethod.IsPublic && getMethod.IsPublic) { propertyType = CSToLuaPropertyType.GetSet; } else if (setMethod != null && setMethod.IsPublic) { propertyType = CSToLuaPropertyType.Set; } else if (getMethod != null && getMethod.IsPublic) { propertyType = CSToLuaPropertyType.Get; } } else if (propertyInfo.CanRead) { if (getMethod != null && getMethod.IsPublic) { propertyType = CSToLuaPropertyType.Get; } } else { if (setMethod != null && setMethod.IsPublic) { propertyType = CSToLuaPropertyType.Set; } } }