Пример #1
0
    static int AsyncLoadBundleAtPath(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(AssetLoader), typeof(string), typeof(System.Action<UnityEngine.AssetBundle>)))
            {
                AssetLoader obj = (AssetLoader)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                System.Action<UnityEngine.AssetBundle> arg1 = null;
                LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

                if (funcType3 != LuaTypes.LUA_TFUNCTION)
                {
                     arg1 = (System.Action<UnityEngine.AssetBundle>)ToLua.ToObject(L, 3);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 3);
                    arg1 = DelegateFactory.CreateDelegate(typeof(System.Action<UnityEngine.AssetBundle>), func) as System.Action<UnityEngine.AssetBundle>;
                }

                System.Collections.IEnumerator o = obj.AsyncLoadBundleAtPath(arg0, arg1);
                ToLua.Push(L, o);
                return 1;
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(AssetLoader), typeof(string), typeof(System.Action<UnityEngine.AssetBundle>), typeof(System.Action<float,float>)))
            {
                AssetLoader obj = (AssetLoader)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                System.Action<UnityEngine.AssetBundle> arg1 = null;
                LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

                if (funcType3 != LuaTypes.LUA_TFUNCTION)
                {
                     arg1 = (System.Action<UnityEngine.AssetBundle>)ToLua.ToObject(L, 3);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 3);
                    arg1 = DelegateFactory.CreateDelegate(typeof(System.Action<UnityEngine.AssetBundle>), func) as System.Action<UnityEngine.AssetBundle>;
                }

                System.Action<float,float> arg2 = null;
                LuaTypes funcType4 = LuaDLL.lua_type(L, 4);

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

                System.Collections.IEnumerator o = obj.AsyncLoadBundleAtPath(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return 1;
            }
            else
            {
                return LuaDLL.luaL_throw(L, "invalid arguments to method: AssetLoader.AsyncLoadBundleAtPath");
            }
        }
        catch(Exception e)
        {
            return LuaDLL.toluaL_exception(L, e);
        }
    }