Exemplo n.º 1
0
    static int Invoke(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        Type[] types0 = { typeof(LuaInterface.LuaFunction), typeof(float) };
        Type[] types1 = { typeof(string), typeof(string), typeof(float) };

        if (LuaScriptMgr.CheckTypes(L, types0, 1) && LuaScriptMgr.CheckParamsType(L, typeof(object), 3, count - 2))
        {
            LuaFunction arg0  = LuaScriptMgr.GetLuaFunction(L, 1);
            float       arg1  = (float)LuaScriptMgr.GetNumber(L, 2);
            object[]    objs2 = LuaScriptMgr.GetParamsObject(L, 3, count - 2);
            LuaTools.Invoke(arg0, arg1, objs2);
            return(0);
        }
        else if (LuaScriptMgr.CheckTypes(L, types1, 1) && LuaScriptMgr.CheckParamsType(L, typeof(object), 4, count - 3))
        {
            string   arg0  = LuaScriptMgr.GetString(L, 1);
            string   arg1  = LuaScriptMgr.GetString(L, 2);
            float    arg2  = (float)LuaScriptMgr.GetNumber(L, 3);
            object[] objs3 = LuaScriptMgr.GetParamsObject(L, 4, count - 3);
            LuaTools.Invoke(arg0, arg1, arg2, objs3);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: LuaTools.Invoke");
        }

        return(0);
    }
Exemplo n.º 2
0
    //回调Lua函数,回调到Lua 的错误处理函数
    protected void LuaErrorCallBack(string sendData, LuaFunction elFunction, Exception e)
    {
        //Debug.Log("C#::HttpClient::asyncSend.error(" + sendData + ", " + elFunction.ToString() + ", " + e.Message + ")");

        AsyncTask.QueueOnMainThread(
            () => { LuaTools.Invoke("NetInterFace.hprose_callback", "sendCallBack", 10, new object[] { sendData, elFunction, e }); }
            );


        //Debug.Log("C#::HttpClient::asyncSend.error(" + sendData + ", " + elFunction.ToString() + e.Message +  ")");
    }