Example #1
0
    void DrawCache()
    {
        var CacheData = CSCommonEditor.GetField <Dictionary <string, ResourcesData> >(ResourcesManager.Instance, "mCacheData");

        if (CacheData != null)
        {
            //  Titile
            GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
            GUI.contentColor = Color.green;
            GUILayout.Label("AssetName", GUILayout.MinWidth(100f));
            GUILayout.Label("Ref", GUILayout.Width(70f));
            GUILayout.Label("Load", GUILayout.Width(70f));
            GUI.contentColor = Color.white;
            GUILayout.EndHorizontal();


            refScrollPos = GUILayout.BeginScrollView(refScrollPos);
            foreach (var item in CacheData)
            {
                GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
                EditorGUILayout.LabelField(item.Key, GUILayout.MinWidth(100f));
                GUILayout.Label(item.Value.ReferenceCount.ToString(), GUILayout.Width(70f));
                GUILayout.Label(item.Value.IsLoad ? "true" : "false", GUILayout.Width(70f));
                GUILayout.EndHorizontal();
            }
            GUILayout.EndScrollView();
        }
        else
        {
            EditorGUILayout.HelpBox("ResourcesManager.Instance.mCacheData can't find! ", MessageType.Info);
        }
    }
Example #2
0
    void DrawChunkData()
    {
        var CacheData = CSCommonEditor.GetField <Dictionary <string, ResourcesChunkData> >(ResourcesManager.Instance, "mChunkData");

        if (CacheData != null)
        {
            chunkScrollPos = GUILayout.BeginScrollView(chunkScrollPos);
            foreach (var item in CacheData)
            {
                if (CSCommonEditor.DrawHeader(item.Key, item.Key))
                {
                    CSCommonEditor.BeginContents();
                    foreach (var subChunk in item.Value.resHash)
                    {
                        GUILayout.Label(subChunk);
                    }
                    CSCommonEditor.EndContents();
                }
            }
            GUILayout.EndScrollView();
        }
        else
        {
            EditorGUILayout.HelpBox("ResourcesManager.Instance.mChunkData can't find! ", MessageType.Info);
        }
    }
Example #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();
        }
    }
Example #4
0
        void DrawCtlTopInfo()
        {
            var stackMng = CSCommonEditor.GetField <StackManager>(UIManager.Instance, "mStackInstance");

            if (stackMng == null)
            {
                return;
            }

            var info = stackMng.GetTopLevel();

            CSCommonEditor.DrawHeader("TopLevel Window");
            if (info != null)
            {
                _DrawStackData(ref info);
            }
            else
            {
                EditorGUILayout.HelpBox("No Window", MessageType.Info);
            }
        }
Example #5
0
        void DrawStack()
        {
            if (CSCommonEditor.DrawHeader("Chunk Info", "CSUI-Stack"))
            {
                var stackMng = CSCommonEditor.GetField <StackManager>(UIManager.Instance, "mStackInstance");
                var listWnd  = CSCommonEditor.GetField <List <StackData> >(stackMng, "mListWindow");
                var chunkWnd = CSCommonEditor.GetField <Dictionary <UIWindowType, StackChunk> >(stackMng, "mChunkWindow");

                GUILayout.Label(string.Format(" Stack Window Count {0} ", listWnd.Count.ToString()), GUILayout.Width(120));

                GUILayout.BeginHorizontal();
                foreach (var iter in chunkWnd)
                {
                    if (GUILayout.Toggle(chunkSelectType == iter.Key, iter.Key.ToString(), "ButtonLeft"))
                    {
                        chunkSelectType = iter.Key;
                    }
                }
                GUILayout.EndHorizontal();

                DrawStackChunkInfo(chunkWnd[chunkSelectType]);
            }
        }
Example #6
0
        void DrawCache()
        {
            if (CSCommonEditor.DrawHeader("Cache", "CSUI-Cache"))
            {
                var info = CSCommonEditor.GetField <Dictionary <UIType, UICache> >(UIManager.Instance, "mWindowInstanceList");
                if (info != null)
                {
                    int  index    = 0;
                    bool isUnload = false;

                    cacheScrollPos = GUILayout.BeginScrollView(cacheScrollPos);

                    foreach (var item in info)
                    {
                        ++index;

                        bool highlight = cacheSelectType == item.Key;
                        GUI.backgroundColor = highlight ? Color.white : new Color(0.8f, 0.8f, 0.8f);
                        GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
                        GUI.backgroundColor = Color.white;
                        GUILayout.Label(index.ToString(), GUILayout.Width(24f));

                        if (GUILayout.Button(item.Key.ToString(), "OL TextField", GUILayout.Height(20f)))
                        {
                            cacheSelectType = item.Key;
                        }

                        if (cacheUnloadType.Contains(item.Key))
                        {
                            GUI.backgroundColor = Color.red;

                            if (GUILayout.Button("Delete", GUILayout.Width(60f)))
                            {
                                isUnload = true;
                            }
                            GUI.backgroundColor = Color.green;
                            if (GUILayout.Button("X", GUILayout.Width(22f)))
                            {
                                cacheUnloadType.Remove(item.Key);
                                isUnload = false;
                            }
                            GUI.backgroundColor = Color.white;
                        }
                        else
                        {
                            if (GUILayout.Button("X", GUILayout.Width(22f)))
                            {
                                cacheUnloadType.Add(item.Key);
                            }
                        }

                        GUILayout.EndHorizontal();
                    }

                    GUILayout.EndScrollView();

                    if (isUnload)
                    {
                        string dBug = "unload item : ";
                        for (int i = 0; i < cacheUnloadType.Count; i++)
                        {
                            dBug += cacheUnloadType[i].ToString() + " ";
                        }
                        //Utility.Log(dBug);
                    }
                }
            }
        }
Example #7
0
        void DrawControllerListWnd()
        {
            var stackMng = CSCommonEditor.GetField <StackManager>(UIManager.Instance, "mStackInstance");

            if (stackMng == null)
            {
                return;
            }
            var listWnd = CSCommonEditor.GetField <List <StackData> >(stackMng, "mListWindow");

            List <StackData> temp = new List <StackData>(listWnd);

            CSCommonEditor.DrawHeader("Window Info");

            //  Titile
            GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
            GUI.contentColor = Color.green;
            GUILayout.Label("Order", GUILayout.Width(50f));
            GUILayout.Label("Instance", GUILayout.MinWidth(100f));
            GUILayout.Label("S-Depth", GUILayout.Width(70f));
            GUILayout.Label("E-Depth", GUILayout.Width(70f));
            GUI.contentColor = Color.white;
            GUILayout.EndHorizontal();

            if (temp.Count == 0)
            {
                EditorGUILayout.HelpBox("No Windows ! ", MessageType.Info);
                return;
            }
            else
            {
                switch (controllerSortType)
                {
                default:
                case CtlSortWnd.Order: break;

                case CtlSortWnd.Depth:
                    temp.Sort((StackData l, StackData r) => { return(l.mStartDepth.CompareTo(r.mStartDepth)); });
                    break;
                }

                GUILayout.Space(5f);

                controllerSortType = (CtlSortWnd)EditorGUILayout.EnumPopup(controllerSortType);

                GUILayout.Space(5f);

                StackData data = null;
                ctlScrollPos1 = GUILayout.BeginScrollView(ctlScrollPos1);
                for (int i = 0; i < temp.Count; i++)
                {
                    data = temp[i];

                    GUILayout.BeginHorizontal("AS TextArea", GUILayout.MinHeight(20f));
                    GUILayout.Label(data.mOrder.ToString(), GUILayout.Width(50f));
                    EditorGUILayout.ObjectField(data.mObject, typeof(GameObject), GUILayout.MinWidth(100f));
                    EditorGUILayout.LabelField(data.mStartDepth.ToString(), GUILayout.Width(70f));
                    EditorGUILayout.LabelField(data.mEndDepth.ToString(), GUILayout.Width(70f));
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndScrollView();
            }
        }