예제 #1
0
        private SharpClass CreateClass(Type classType, Type superType, SharpClass module)
        {
            string name = GetTableName(classType);

            LuaNativeFunction dctor = null;

            if (classType.IsValueType)
            {
                if (!classType.IsUnManaged()) //未注册Wrap,用反射版api, UnmanagedType同Object
                {
                    dctor = gcFn;
                }
            }
            else
            {
                dctor = gcFn;
            }

            LuaRef meta      = CreateClass(module.Meta, name, classType, superType, dctor);
            var    bindClass = new SharpClass(module, meta);

            bindClass.Name = name;
            bindClass.SetClassType(classType);
            registeredClass.Add(classType, bindClass);
            return(bindClass);
        }
예제 #2
0
 public SharpClass(SharpClass parent, LuaRef meta)
 {
     this.meta = meta;
     this.meta.CheckTable();
     this.parent = parent;
 }
예제 #3
0
 public SharpClass(SharpClass parent)
 {
     this.parent = parent;
 }