Пример #1
0
        /*void Update()
         * {
         *  if (true)
         *  {
         *      //CheckNewLoaders();
         *      CheckQueue();
         *  }
         * }
         *
         * void CheckQueue()
         * {
         *  while (waittingLoaders.Count > 0 && runningLoaders.Count < MAX_REQUEST)
         *  {
         *      LoadBundleAsync(waittingLoaders[0]);
         *      runningLoaders.Add(waittingLoaders[0]);
         *      waittingLoaders.RemoveAt(0);
         *  }
         * }*/

        void LoadBundleAsync(BundleLoader loader)
        {
            if (!loader.mainObject)
            {
                loader.LoadAsync();
            }
        }
Пример #2
0
        public void LoadAsync(string path, Action <BundleLoader> onLoadAssetComplete = null)
        {
            BundleLoader loader = BundleLoader.CreateLoader(path);

            if (loader.mainObject)
            {
                onLoadAssetComplete(loader);
            }
            else
            {
                loader.onComplete += onLoadAssetComplete;
            }
            loader.LoadAsync();
        }