Exemplo n.º 1
0
    private List <LoadInfo> CreateLoadInfoList(PredownloadTable table, bool need_tutorial)
    {
        List <LoadInfo> list = new List <LoadInfo>();

        if (need_tutorial)
        {
            AddLoadInfoList(list, table.tutorialDatas);
            tutorialCount = list.Count;
        }
        AddLoadInfoList(list, table.preloadDatas);
        AddLoadInfoList(list, table.autoDatas);
        AddLoadInfoList(list, table.manualDatas);
        return(list);
    }
Exemplo n.º 2
0
    private IEnumerator Start()
    {
        LoadingQueue loading_queue = new LoadingQueue(this);

        ResourceManager.enableCache  = false;
        ResourceManager.internalMode = true;
        LoadObject lo_table = loading_queue.Load(RESOURCE_CATEGORY.TABLE, "PredownloadTable", false);

        ResourceManager.internalMode = false;
        ResourceManager.enableCache  = true;
        yield return((object)loading_queue.Wait());

        PredownloadTable table     = lo_table.loadedObject as PredownloadTable;
        List <LoadInfo>  info_list = CreateLoadInfoList(table, isOpening);
        int info_index             = 0;

        totalCount = info_list.Count;
        List <LoadObject> loading_list = new List <LoadObject>();

        while (loadedCount < totalCount)
        {
            yield return((object)null);

            MonoBehaviourSingleton <ResourceManager> .I.loadingAssetCountLimit = 4;
            if (stopFlags == (STOP_FLAG)0)
            {
                if (isLoadingInOpening)
                {
                    MonoBehaviourSingleton <ResourceManager> .I.loadingAssetCountLimit = 1;
                }
                while (loading_list.Count < 4 && loadedCount + loading_list.Count < totalCount)
                {
                    List <LoadInfo> list = info_list;
                    int             index;
                    info_index = (index = info_index) + 1;
                    LoadInfo info = list[index];
                    if (isOpening && info_index < tutorialCount && info.category != RESOURCE_CATEGORY.STAGE_SCENE)
                    {
                        ResourceManager.enableCache  = true;
                        ResourceManager.downloadOnly = false;
                    }
                    else
                    {
                        ResourceManager.enableCache  = false;
                        ResourceManager.downloadOnly = true;
                    }
                    bool save_internalMode = ResourceManager.internalMode;
                    ResourceManager.internalMode = false;
                    LoadObject lo = (info.resourceNames == null || info.resourceNames.Length <= 0) ? loading_queue.Load(info.category, info.pakageName, false) : loading_queue.Load(info.category, info.pakageName, info.resourceNames, false);
                    if (lo != null)
                    {
                        loading_list.Add(lo);
                    }
                    ResourceManager.internalMode = save_internalMode;
                    ResourceManager.downloadOnly = false;
                    ResourceManager.enableCache  = true;
                }
                int j = 0;
                for (int i = loading_list.Count; j < i; j++)
                {
                    if (!loading_list[j].isLoading)
                    {
                        loading_list[j] = null;
                        loading_list.RemoveAt(j);
                        j--;
                        i--;
                        loadedCount++;
                    }
                }
            }
        }
    }