Пример #1
0
    static int AsyncLoadAtPath(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 4);
            AssetLoader obj = (AssetLoader)ToLua.CheckObject(L, 1, typeof(AssetLoader));
            string arg0 = ToLua.CheckString(L, 2);
            AssetLoader.EAssetBaseType arg1 = (AssetLoader.EAssetBaseType)ToLua.CheckObject(L, 3, typeof(AssetLoader.EAssetBaseType));
            System.Action<object> arg2 = null;
            LuaTypes funcType4 = LuaDLL.lua_type(L, 4);

            if (funcType4 != LuaTypes.LUA_TFUNCTION)
            {
                 arg2 = (System.Action<object>)ToLua.CheckObject(L, 4, typeof(System.Action<object>));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 4);
                arg2 = DelegateFactory.CreateDelegate(typeof(System.Action<object>), func) as System.Action<object>;
            }

            System.Collections.IEnumerator o = obj.AsyncLoadAtPath(arg0, arg1, arg2);
            ToLua.Push(L, o);
            return 1;
        }
        catch(Exception e)
        {
            return LuaDLL.toluaL_exception(L, e);
        }
    }