示例#1
0
    LuaInstance()
    {
        lua_ = LuaAPI.NewState(IntPtr.Zero);
        lua_.L_OpenLibs();
        LuaClassList.Init();

        for (int i = 0; i < 10; i++)
        {
            params_[i] = new object[i];
        }

        //Register Debug.Log
        Type     debugClassType = typeof(Debug);
        LuaClass lua_class      = RegisterLuaClass(debugClassType);

        FuncInfo[] funcInfos;
        if (LuaClassList.classes.TryGetValue(debugClassType, out funcInfos))
        {
            for (int j = 0; j < funcInfos.Length; j++)
            {
                lua_class.RegisterStaticFunction(funcInfos[j]);
            }
        }
        lua_class.EndRegisterClass();
    }
示例#2
0
 LuaInstance()
 {
     for (int i = 0; i < 10; i++)
     {
         params_[i] = new object[i];
     }
     LuaClassList.Init();
     PrepareLuaState();
 }