Exemple #1
0
    static int SetEndGameAction(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            FightManager        obj       = (FightManager)ToLua.CheckObject(L, 1, typeof(FightManager));
            System.Action <int> arg0      = null;
            LuaTypes            funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (System.Action <int>)ToLua.CheckObject(L, 2, typeof(System.Action <int>));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(System.Action <int>), func) as System.Action <int>;
            }

            obj.SetEndGameAction(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }