Ejemplo n.º 1
0
 static int OpenReflectionLibs(IntPtr L)
 {
     try
     {
         GLuaState state = GLuaState.Get(L);
         state.BeginModule(null);
         state.BeginModule("LuaInterface");
         LuaInterface_LuaMethodWrap.Register(state);
         LuaInterface_LuaPropertyWrap.Register(state);
         LuaInterface_LuaFieldWrap.Register(state);
         LuaInterface_LuaConstructorWrap.Register(state);
         state.EndModule();
         state.EndModule();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 2
0
    public static void Bind(GLuaState L)
    {
        float t = Time.realtimeSinceStartup;

        L.BeginModule(null);
        L.BeginModule("UnityEngine");

        L.RegFunction("DelegateMethod", UnityFrame_DelegateMethod);
        L.RegFunction("DelegateUIResposition", UnityFrame_DelegateUIResposition);
        L.RegFunction("DelegateBoolMethod", UnityFrame_DelegateBoolMethod);
        L.RegFunction("DelegateVoid", UnityFrame_DelegateVoid);
        L.RegFunction("DelegateObject", UnityFrame_DelegateObject);
        L.RegFunction("DelegateVectorMethod", UnityFrame_DelegateVectorMethod);
        L.RegFunction("DelegateNForeach_UnityFrame_IEntityHnadle", UnityFrame_DelegateNForeach_UnityFrame_IEntityHnadle);
        L.EndModule();
        L.BeginModule("System");
        L.RegFunction("Action", System_Action);
        L.RegFunction("Predicate_int", System_Predicate_int);
        L.RegFunction("Action_int", System_Action_int);
        L.RegFunction("Comparison_int", System_Comparison_int);
        L.EndModule();
        L.EndModule();
        Debugger.Log("Register lua type cost time: {0}", Time.realtimeSinceStartup - t);
    }
Ejemplo n.º 3
0
        //绑定UI
        //绑定索引方法,在Lua中直接索引更新键与直接赋值更新键
        static void UF_RegisterUI(GLuaState L)
        {
            L.LuaGetGlobal("_G");
            L.BeginModule("UnityFrame");
            //UIUpdateGroup
            L.BeginClass(typeof(UnityFrame.UIUpdateGroup), typeof(UnityFrame.UIObject));
            L.RegFunction(".gui", UF_get_ui);
            L.RegFunction(".sui", UF_set_ui);
            L.EndClass();
            //UIContent
            L.BeginClass(typeof(UnityFrame.UIContent), typeof(UnityFrame.UIObject));
            L.RegFunction(".gui", UF_get_ui);
            L.RegFunction(".sui", UF_set_ui);
            L.EndClass();

            L.EndModule();
        }