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(); }
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); } }
private void DrawExporterPlan() { GUILayout.Space(5f); //isShowExporterPlan = EditorGUILayout.ToggleLeft("Exproter Plan", isShowExporterPlan); if (CSCommonEditor.DrawHeader("Exproter Plan", "Exproter Plan")) { var data = BMDataAccessor.ExporterPlan; List <int> deleteExporter = new List <int>(); List <int> deleteSuffix = new List <int>(); if (GUILayout.Button("Add New Exporter Plan")) { data.ListExporterPlan.Add(new ExporterData()); } for (int index = data.ListExporterPlan.Count - 1; index >= 0; index--) { EditorGUI.indentLevel = 0; DrawSubExporterPlan(data.ListExporterPlan[index], ref deleteSuffix); } // delete foreach (int i in deleteExporter) { data.ListExporterPlan.RemoveAt(i); } } }
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(); } }
void DrawStackChunkInfo(StackChunk chunk) { EditorGUILayout.LabelField("Chunk Type ", chunk.mChunkType.ToString()); EditorGUILayout.LabelField("Chunk Start Depth ", chunk.mStartDepth.ToString()); EditorGUILayout.LabelField("Chunk Child Count ", chunk.mChunkList.Count.ToString()); chunkScrollPos = GUILayout.BeginScrollView(chunkScrollPos); for (int i = 0; i < chunk.mChunkList.Count; i++) { var info = chunk.mChunkList[i]; if (CSCommonEditor.DrawHeader(info.mInfo.Key.ToString(), info.mInfo.Key.ToString())) { _DrawStackData(ref info); } } GUILayout.EndScrollView(); }
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); } }
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]); } }
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); }
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); } } } }
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(); } }