Example #1
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 #2
0
        void DrawController()
        {
            CSCommonEditor.DrawHeader("Controller");

            CSCommonEditor.BeginContents();
            GUILayout.BeginHorizontal();
            ctlSelectShowType = (UIType)EditorGUILayout.EnumPopup("Show UI Type", ctlSelectShowType);
            if (GUILayout.Button("Show"))
            {
                UIManager.Instance.ShowWnd(ctlSelectShowType);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            ctlSelectHideType = (UIType)EditorGUILayout.EnumPopup("Hide UI Type", ctlSelectHideType);
            if (GUILayout.Button("Hide"))
            {
                UIManager.Instance.HideWnd(ctlSelectHideType);
            }
            GUILayout.EndHorizontal();
            CSCommonEditor.EndContents();

            DrawCtlTopInfo();
            DrawControllerListWnd();
        }
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 _DrawStackData(ref StackData info)
        {
            CSCommonEditor.BeginContents();

            EditorGUILayout.ObjectField("Instances ", info.mObject, typeof(GameObject));
            EditorGUILayout.LabelField("Order ", info.mOrder.ToString());
            EditorGUILayout.LabelField("Start Depeth ", info.mStartDepth.ToString());
            EditorGUILayout.LabelField("End Depeth ", info.mEndDepth.ToString());
            GUILayout.Space(5f);
            EditorGUILayout.LabelField("UI Type ", info.mInfo.Key.ToString());
            EditorGUILayout.LabelField("Owner Type ", CSCommonEditor.ToString(info.mInfo.Owner));
            EditorGUILayout.LabelField("UI Wnd Type ", info.mInfo.WinType.ToString());
            EditorGUILayout.LabelField("UI Effect Type ", info.mInfo.WinEffect.ToString());
            EditorGUILayout.LabelField("UI Resources AssetName ", info.mInfo.GetResourcePath());

            CSCommonEditor.EndContents();
        }
Example #5
0
    void DrawController()
    {
        CSCommonEditor.BeginContents();

        GUILayout.BeginHorizontal();
        GUILayout.Label("Res AssetName", GUILayout.Width(70));
        ctlResName = GUILayout.TextArea(ctlResName, GUILayout.MinWidth(120));
        GUILayout.Label("Chunk AssetName", GUILayout.Width(70));
        ctlChunkName = GUILayout.TextField(ctlChunkName, GUILayout.MinWidth(120));
        isInstance   = GUILayout.Toggle(isInstance, "IsInstance", GUILayout.MinWidth(120));
        if (GUILayout.Button("Load", GUILayout.Width(70)))
        {
            ResourcesManager.Instance.Load(ctlResName, ctlChunkName, () =>
            {
                if (isInstance)
                {
                    GameObject obj = ResourcesManager.Instance.GetResources <GameObject>(ctlResName);
                    Object.Instantiate(obj);
                }
            });
        }
        GUILayout.EndHorizontal();

        if (CSCommonEditor.DrawTextButton("Chunk AssetName", ref ctlUnChunkName, "UnLoad"))
        {
            ResourcesManager.Instance.Unload(ctlUnChunkName);
        }

        if (CSCommonEditor.DrawTextButton("Res AssetName", ref ctlUnResName, "UnLoad"))
        {
            ResourcesManager.Instance.Editor_UnloadRes(ctlUnResName);
        }

        CSCommonEditor.EndContents();

        GUILayout.Space(10f);
    }
Example #6
0
    private bool DrawSubExporterPlan(ExporterData iter, ref List <int> deleteSuffix)
    {
        string title = BundleHelp.FullPath2AssetPath(ref iter.Path);

        if (!CSCommonEditor.DrawHeader(title ?? "<空>", iter.Path, true, true))
        {
            return(false);
        }

        CSCommonEditor.BeginContents();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Path ", title);
        if (GUILayout.Button("...", GUILayout.MaxWidth(24)))
        {
            iter.Path = EditorUtility.OpenFolderPanel("Choose Output Path", Application.dataPath, "");
        }
        GUI.color = Color.red;
        if (GUILayout.Button("-", GUILayout.MaxWidth(24)))
        {
            return(true);
        }
        GUI.color = Color.white;
        EditorGUILayout.EndHorizontal();

        EditorGUI.indentLevel = 1;

        for (int i = iter.Suffixs.Count - 1; i >= 0; i--)
        {
            EditorGUILayout.BeginHorizontal();

            string safeSuffix = EditorGUILayout.TextField("Suffix ", iter.Suffixs[i]);
            if (string.IsNullOrEmpty(safeSuffix))
            {
                safeSuffix = "*.prefab";
            }
            else if (!safeSuffix.StartsWith("*."))
            {
                safeSuffix = "*." + safeSuffix;
            }
            iter.Suffixs[i] = safeSuffix;

            GUI.color = Color.red;
            if (GUILayout.Button("-", GUILayout.MaxWidth(24)))
            {
                deleteSuffix.Add(i);
            }
            GUI.color = Color.white;
            EditorGUILayout.EndHorizontal();
        }


        //  delelte click '-'
        foreach (int j in deleteSuffix)
        {
            iter.Suffixs.RemoveAt(j);
        }

        deleteSuffix.Clear();

        GUI.color = Color.green;
        //  new suffix
        if (GUILayout.Button("Add New Suffix"))
        {
            iter.Suffixs.Add("*.prefab");
        }
        GUI.color = Color.white;

        CSCommonEditor.EndContents();

        return(false);
    }