Exemplo n.º 1
0
 private int sortAssetLoaderWidget(AssetWidget a, AssetWidget b)
 {
     if (a.weight > b.weight)
     {
         return(-1);
     }
     if (a.weight < b.weight)
     {
         return(1);
     }
     return(0);
 }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
 /// <summary>
 /// 添加物件
 /// </summary>
 /// <param name="sceneWidget">物件</param>
 public void LoadAsset(AssetWidget widget)
 {
     loadList.Add(widget);
 }