示例#1
0
    /// <summary>
    /// 多个资源加载完成
    /// </summary>
    /// <param name="multi"></param>

    private void OnMultiCompleted(MultiForWww multi)
    {
        System.Action call = (System.Action)multi.Data;
        if (call != null)
        {
            call();
        }

        Debug.Log("Call Multi Finish !");
    }
示例#2
0
    private void CreateLoadTask(ResourcesChunkData chunkData, List <string> resList, System.Action call)
    {
        MultiForWww multi = new MultiForWww
        {
            Data           = call,
            OnAllCompleted = OnMultiCompleted,
            OnSubCompleted = OnLoadCompleted
        };

        multi.Start(resList);
        mLoadTask.Add(multi);
    }
示例#3
0
    void DrawLoadTask()
    {
        var CacheData = CSCommonEditor.GetField <List <MultiForWww> >(ResourcesManager.Instance, "mLoadTask");

        for (int i = 0; i < CacheData.Count; i++)
        {
            loadTaskScrollPos = GUILayout.BeginScrollView(loadTaskScrollPos);

            if (CSCommonEditor.DrawHeader((i + 1).ToString(), "loadTask" + i.ToString()))
            {
                MultiForWww data = CacheData[i];

                CSCommonEditor.BeginContents();

                if (data.ResList.Count == 0)
                {
                    EditorGUILayout.LabelField("Current Load", "无");
                }
                else
                {
                    EditorGUILayout.LabelField("Current Load", data.ResList[data.Index]);
                }
                EditorGUILayout.LabelField("Parallel Load", data.ParallelCount.ToString());
                EditorGUILayout.LabelField("Is Error", data.IsError.ToString());


                for (int k = 0; k < data.WwwList.Count; k++)
                {
                    EditorGUILayout.LabelField("Url", data.WwwList[k].Url);
                    EditorGUILayout.LabelField("State", data.WwwList[k].mState.ToString());
                    if (data.WwwList[k].Www != null)
                    {
                        EditorGUILayout.LabelField("Progress", data.WwwList[i].Www.progress.ToString());
                    }
                }

                GUILayout.Space(5f);
                EditorGUILayout.LabelField("Res Stack");
                for (int j = 0; j < data.ResList.Count; j++)
                {
                    EditorGUILayout.LabelField(j.ToString(), data.ResList[j]);
                }

                CSCommonEditor.EndContents();
            }

            GUILayout.EndScrollView();
        }
    }