static int LoadCacheBundleAsync(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                AL.PoolCache.CachePoolAsync arg0 = (AL.PoolCache.CachePoolAsync)ToLua.CheckObject <AL.PoolCache.CachePoolAsync>(L, 1);
                string arg1 = ToLua.CheckString(L, 2);
                AL.Resources.ALoadOperation o = AL.Resources.ResourceManager.LoadCacheBundleAsync(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                AL.PoolCache.CachePoolAsync arg0 = (AL.PoolCache.CachePoolAsync)ToLua.CheckObject <AL.PoolCache.CachePoolAsync>(L, 1);
                string arg1 = ToLua.CheckString(L, 2);
                string arg2 = ToLua.CheckString(L, 3);
                AL.Resources.ALoadOperation o = AL.Resources.ResourceManager.LoadCacheBundleAsync(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: AL.Resources.ResourceManager.LoadCacheBundleAsync"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
        public void Finish(ALoadOperation loader)
        {
            progress = 1.0f;

            if (OnFinish != null)
            {
                OnFinish.Invoke(loader);
                OnFinish = null;
            }
        }
 static int OnLoad(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)ToLua.CheckObject <AL.Resources.ALoadOperation>(L, 1);
         obj.OnLoad();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int IsDone(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)ToLua.CheckObject <AL.Resources.ALoadOperation>(L, 1);
         bool o = obj.IsDone();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 5
0
 static int AddLoader(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         AL.Resources.LoadStageAsync obj  = (AL.Resources.LoadStageAsync)ToLua.CheckObject <AL.Resources.LoadStageAsync>(L, 1);
         AL.Resources.ALoadOperation arg0 = (AL.Resources.ALoadOperation)ToLua.CheckObject <AL.Resources.ALoadOperation>(L, 2);
         int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
         obj.AddLoader(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 添加场景资源加载器
        /// </summary>
        /// <param name="loader">加载器</param>
        /// <param name="weight">资源权重</param>
        public void AddLoader(ALoadOperation loader, int weight)
        {
            Weight += weight;

            AsyncLoader asyncLoader = new AsyncLoader();

            asyncLoader.Weight = weight;
            asyncLoader.Loader = loader;

            this.assets.Add(asyncLoader);

            if (nextLoader == null)
            {
                nextLoader = asyncLoader;
                curLoader  = nextLoader;
            }
        }
    static int set_OnFinish(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)o;
            System.Action <AL.Resources.ALoadOperation> arg0 = (System.Action <AL.Resources.ALoadOperation>)ToLua.CheckDelegate <System.Action <AL.Resources.ALoadOperation> >(L, 2);
            obj.OnFinish = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OnFinish on a nil value"));
        }
    }
    static int get_Current(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)o;
            object ret = obj.Current;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Current on a nil value"));
        }
    }
    static int get_assetPath(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)o;
            string ret = obj.assetPath;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index assetPath on a nil value"));
        }
    }
    static int get_Progress(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)o;
            float ret = obj.Progress;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Progress on a nil value"));
        }
    }
    static int get_OnFinish(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AL.Resources.ALoadOperation obj = (AL.Resources.ALoadOperation)o;
            System.Action <AL.Resources.ALoadOperation> ret = obj.OnFinish;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OnFinish on a nil value"));
        }
    }
Ejemplo n.º 12
0
        public void Update()
        {
            if (isLoading || loadList.Count == 0)
            {
                return;
            }

            loadList.Sort(sortAssetLoaderWidget);
            for (int i = 0, count = loadList.Count; i < count; i++)
            {
                AssetWidget uiWidget = loadList[i];

                ALoadOperation loader = ResourceManager.LoadBundleAsync(uiWidget.Name);
                loader.OnFinish = uiWidget.callback;

                this.contain.AddLoader(loader, 1);
            }
            loadList.Clear();

            isLoading = true;
            this.behaviour.StartCoroutine(this.asyncLoading());
        }