Beispiel #1
0
        private string GetFunName(CSToLuaFieldType fType)
        {
            switch (fType)
            {
            case CSToLuaFieldType.Get:
                return(string.Format("GetField_{0}", fieldInfo.Name));

            case CSToLuaFieldType.GetSet:
                return(string.Format("GetSetField_{0}", fieldInfo.Name));

            case CSToLuaFieldType.Set:
                return(string.Format("SetField_{0}", fieldInfo.Name));
            }
            return("");
        }
Beispiel #2
0
        public CSToLuaFieldRegister(CSToLuaClassRegister cr, FieldInfo fi)
        {
            classRegister = cr;
            fieldInfo     = fi;

            if (fieldInfo.IsStatic)
            {
                if ((fieldInfo.Attributes & FieldAttributes.Literal) == 0)
                {
                    fieldType = CSToLuaFieldType.GetSet;
                }
                fieldType = CSToLuaFieldType.Get;
            }
            else
            {
                if ((fieldInfo.Attributes & FieldAttributes.Literal) == 0)
                {
                    fieldType = CSToLuaFieldType.GetSet;
                }
                fieldType = CSToLuaFieldType.Get;
            }
        }