private bool DrawRowHeader() { bool changed = false; EditorGUILayout.BeginVertical(); changed |= EditorGUIUtil.ObjectField <UITableCell>(ref table.defaultPrefab, true, W_Option, H_Option); EditorGUILayout.LabelField("Align", EditorStyles.boldLabel, H_Option); EditorGUILayout.LabelField("Size", EditorStyles.boldLabel, H_Option); EditorGUILayout.LabelField("Index", EditorStyles.boldLabel, H_Option); int row = table.isVertical? table.GetMaxPerLine(): table.rowCount; table.InitArray(); for (int r = 0; r < row; r++) { EditorGUILayout.BeginHorizontal(); changed |= EditorGUIUtil.ObjectField <UITableCell>(ref table.rowPrefab[r], true, GUILayout.Width(WIDTH - 20), H_Option); changed |= EditorGUIUtil.Popup <UITableLayout.VAlign>(ref table.valigns[r], EnumUtil.Values <UITableLayout.VAlign>(), GUILayout.Width(40), H_Option); changed |= EditorGUIUtil.IntField(null, ref table.rowHeight[r], GUILayout.Width(WIDTH - 30), H_Option); EditorGUILayout.LabelField((r + 1).ToString(), EditorStyles.boldLabel, GUILayout.Width(20), H_Option); EditorGUILayout.EndHorizontal(); } if (!IsHorizontal()) { EditorGUILayout.LabelField("", W_Option); EditorGUILayout.LabelField("", W_Option); EditorGUILayout.LabelField("", W_Option); } EditorGUILayout.EndVertical(); if (changed) { table.InitArray(); } return(changed); }
protected override bool OnInspectorGUI(FontChangeData data, int i) { bool changed = false; EditorGUILayout.BeginVertical(); if (EditorGUIUtil.ObjectField <Font>("DynamicFont", ref data.font, false)) { changed = true; if (data.font != null) { data.uiFont = null; } } if (EditorGUIUtil.ObjectField <UIFont>("Reference Font", ref data.uiFont, false)) { changed = true; if (data.uiFont != null) { data.font = null; } } ArrayDrawer <UIFont> arr = null; if (!arrMap.TryGetValue(data, out arr)) { arr = new ArrayDrawer <UIFont>(data, "references"); arr.allowSceneObject = false; arrMap[data] = arr; } arr.OnInspectorGUI(); EditorGUILayout.EndVertical(); return(changed); }
public override void OnInspectorGUI() { GUI.enabled = true; EditorGUILayout.BeginHorizontal(); if (EditorGUIUtil.ObjectField <GameObject>("Root", ref root, true)) { Classify(ref root); } if (GUILayout.Button("Refresh", GUILayout.ExpandWidth(false)) || root == null) { Classify(ref root); } GUI.enabled = root != null; if (GUILayout.Button("Rename", GUILayout.ExpandWidth(false))) { Rename(); } GUI.enabled = true; EditorGUILayout.EndHorizontal(); scroll = EditorGUILayout.BeginScrollView(scroll); VisualizeGroup(); EditorGUIUtil.DrawSeparator(); VisualizeDups(); EditorGUILayout.EndScrollView(); }
public void OnInspectorGUI() { if (EditorGUIUtil.ObjectField <GameObject>("Empty Obj", ref grid.emptyObj, true)) { EditorUtil.SetDirty(grid.emptyObj); } OnGridGUI(); }
private bool DrawColumn() { bool changed = false; int columnSize = table.isHorizontal? table.GetMaxPerLine(): table.columnCount; int contentSize = table.columnCount; for (int c = 0; c < columnSize; c++) { EditorGUILayout.BeginVertical(); changed |= EditorGUIUtil.ObjectField <UITableCell>(ref table.columnPrefab[c], true, GUILayout.ExpandWidth(false), H_Option); changed |= EditorGUIUtil.Popup <UITableLayout.HAlign>(ref table.haligns[c], EnumUtil.Values <UITableLayout.HAlign>(), GUILayout.Width(WIDTH - 20), H_Option); changed |= EditorGUIUtil.IntField(null, ref table.columnWidth[c], GUILayout.Width(WIDTH - 20), H_Option); EditorGUILayout.LabelField(c.ToString(), EditorStyles.boldLabel, W_Option, H_Option); int row = table.rowCount; if (c < contentSize) { for (int r = 0; r < row; r++) { changed |= DrawCell(r, c); } // Draw Column +/- buttons EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("A", "Add Selected"), GUILayout.ExpandWidth(false), H_Option)) { AddSelected(c, UITableLayout.Arrangement.Vertical); changed = true; } if (GUILayout.Button("+", GUILayout.ExpandWidth(false), H_Option)) { #pragma warning disable 0618 table.AddColumn(c + 1, new UITableCell[table.rowCount]); #pragma warning restore 0618 changed = true; } GUI.enabled = c >= table.columnHeader; if (GUILayout.Button("-", GUILayout.ExpandWidth(false), H_Option)) { if (EditorUtility.DisplayDialog("Confirm", "Delete column " + (c + 1), "OK", "Cancel")) { #pragma warning disable 0618 table.RemoveColumn(c); #pragma warning restore 0618 table.Reposition(); changed = true; } } GUI.enabled = true; EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); } return(changed); }
private bool DrawCell(int r, int c) { bool changed = false; UITableCell cell = table.GetCell(r, c); if (EditorGUIUtil.ObjectField <UITableCell>(ref cell, true, W_Option, GUILayout.Height(HEIGHT - 1))) { table.SetCell(r, c, cell); changed = true; } return(changed); }
public override void OnHeaderGUI() { bool changed = EditorGUIUtil.ObjectField <GameObject>("Scene Root", ref sceneRoot, true); changed |= EditorGUIUtil.ObjectField <UIAtlas>("From", ref atlasFrom, false); changed |= EditorGUIUtil.ObjectField <UIAtlas>("To", ref atlasTo, false); NGUIEditorTools.DrawSeparator(); if (changed && atlasFrom != null && atlasTo != null) { duplicateSprites = FindDuplicate(atlasFrom, atlasTo); } }
private bool DrawAddColumn() { showAddColumn = EditorGUILayout.Foldout(showAddColumn, "Add Column"); if (showAddColumn) { if (!grid.isHorizontal) { EditorGUILayout.HelpBox("Currently only Horizontal grid type is supported", MessageType.Warning); return(false); } EditorGUIUtil.ObjectField <UILabel>("Title Label(Prefab)", ref titleLabelPrefab, true, GUILayout.ExpandWidth(false)); if (EditorGUIUtil.PopupNullable <GridStyle>(null, ref currentStyle, gridStyles)) { selectedColumn = null; return(true); } if (GUILayout.Button("Apply")) { grid.totalWidth = currentStyle.width; Vector2 minSize = grid.cellMinSize; minSize.y = currentStyle.rowHeight; grid.cellMinSize = minSize; } if (currentStyle != null) { EditorGUIUtil.PopupNullable <ColumnWidth>(null, ref selectedColumn, currentStyle.columnWidth); GUI.enabled = titleLabelPrefab != null && selectedColumn != null; if (GUILayout.Button("Add")) { int lastCol = GetLastColumn(); for (int r = 1, max = grid.rowHeader; r < max; r++) { UITableCell cell = null; #pragma warning disable 0618 grid.Insert((lastCol + 1) * r - 1, cell); #pragma warning restore 0618 } grid.maxPerLine = Math.Max(lastCol + 1, grid.maxPerLine); grid.InitArray(); grid.columnWidth[lastCol] = selectedColumn.width; grid.SetCell(grid.rowHeader - 1, lastCol, CreateLabel(selectedColumn.name, lastCol + 1)); return(true); } } } return(false); }
public override void OnHeaderGUI() { EditorGUIUtil.ObjectField <GameObject>("Scene Root", ref sceneRoot, true); GUI.enabled = sceneRoot != null; ComponentSelector.Draw <UIAtlas>("Select", NGUISettings.atlas, OnSelectAtlas, true); EditorGUIUtil.TextField("Filter", ref filter); if (EditorGUIUtil.Toggle("Expand", ref expand)) { foreach (string s in spriteMap.Keys) { foldMap[s] = expand; } } GUI.enabled = true; NGUIEditorTools.DrawSeparator(); }
public override void OnHeaderGUI() { EditorGUIUtil.ObjectField <LexiconRegistry>("Lexicon Registry", ref lexReg, false); if (lexReg == null) { return; } EditorGUIUtil.PopupEnum <SystemLanguage>("Mother language", ref motherLang); EditorGUIUtil.PopupEnum <SystemLanguage>("Language", ref lang); fold = EditorGUILayout.Foldout(fold, "Translate All"); if (fold) { if (GUILayout.Button("Convert all Scene and prefab") && EditorUtility.DisplayDialog("Confirm", "Convert All?", "OK", "Cancel")) { Lexicon.SetMotherLanguage(motherLang); Lexicon.SetLanguage(lang); TranslateLanguage(); } } EditorGUIUtil.Toggle("Lock", ref locked); if (EditorGUIUtil.Toggle("Visible Only", ref visibleOnly)) { roots = null; } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Reload Table", GUILayout.Height(30))) { ReloadTable(); ApplyTableToText(); } if (GUILayout.Button("Apply table to text", GUILayout.Height(30))) { ApplyTableToText(); } if (GUILayout.Button("Revert", GUILayout.Height(30))) { Clear(); } EditorGUILayout.EndHorizontal(); DrawFindLexiconGUI(); }
public override void OnInspectorGUI() { drawer.Draw(); EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField <Transform>(ref searchRoot, true); GUI.enabled = searchRoot != null; if (!Application.isPlaying && GUILayout.Button("Search")) { HashSet <GameObject> set = new HashSet <GameObject>(handler.buttons); foreach (UIButton b in searchRoot.GetComponentsInChildren <UIButton>()) { if (!set.Contains(b.gameObject)) { ArrayUtil.Add(ref handler.buttons, b.gameObject); } } InvalidateArray(); } EditorGUILayout.EndHorizontal(); GUI.enabled = true; }
public override void OnInspectorGUI() { if (toggleInspector.Draw()) { InvalidateArray(); } EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField <Transform>(ref searchRoot, true); GUI.enabled = searchRoot != null; if (GUILayout.Button("Search")) { HashSet <GameObject> set = new HashSet <GameObject>(handler.toggleObj); foreach (UIToggle t in searchRoot.GetComponentsInChildren <UIToggle>()) { if (!set.Contains(t.gameObject)) { ArrayUtil.Add(ref handler.toggleObj, t.gameObject); } } InvalidateArray(); } GUI.enabled = true; EditorGUILayout.EndHorizontal(); }
public override void OnInspectorGUI() { bool changed = false; if (attach.anchor != null) { Object t = attach.anchor.container != null? (Object)attach.anchor.container: (Object)attach.anchor.uiCamera; if (EditorGUIUtil.ObjectField("Target", ref t, true)) { attach.anchor.uiCamera = null; attach.anchor.container = null; if (t is Camera) { attach.anchor.uiCamera = t as Camera; } else { attach.anchor.container = t as GameObject; } changed = true; } } if (anchorObj == null && pivotObj == null) { anchorObj = attach.gameObject; // Add pivot GameObject between anchor and anchor children. if (anchorObj.transform.childCount == 1 && anchorObj.transform.GetChild(0).GetComponent <UIPivot>() != null) { pivotObj = anchorObj.transform.GetChild(0).gameObject; } else { pivotObj = new GameObject("_pivot"); pivotObj.tag = anchorObj.tag; pivotObj.transform.SetParent(anchorObj.transform, false); List <Transform> children = new List <Transform>(); foreach (Transform t in anchorObj.transform) { if (t != anchorObj.transform && t != pivotObj.transform) { children.Add(t); } } foreach (Transform t in children) { t.parent = pivotObj.transform; } } Init(); changed = true; } else { Color oldBg = GUI.backgroundColor; GUI.backgroundColor = Color.gray; changed |= EditorGUIUtil.ObjectField <GameObject>("Anchor", ref anchorObj, true); changed |= EditorGUIUtil.ObjectField <GameObject>("Pivot", ref pivotObj, true); GUI.backgroundColor = oldBg; } if (target != null && anchorObj != null && pivotObj != null) { if (changed) { Init(); } if (anchorObj == pivotObj || anchorObj.transform.IsChildOf(pivotObj.transform)) { EditorGUILayout.HelpBox("Anchor and Pivot should not be in the same GameObject", MessageType.Error); } else { EditorGUILayout.BeginVertical(); for (int row = 0; row < 5; row++) { EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); for (int col = 0; col < 5; col++) { int buttonWidth = 30; int buttonHeight = 30; Color c = Color.white; if (row == 0 || row == 4) { buttonHeight = 25; c = Color.gray; } if (col == 0 || col == 4) { buttonWidth = 25; c = Color.gray; } GUI.backgroundColor = c; if (GUILayout.Button("A", GUILayout.Width(buttonWidth), GUILayout.Height(buttonHeight))) { attach.pivot.pivot = pivots[row, col]; attach.anchor.side = sides[row, col]; attach.Reposition(sides[row, col], pivots[row, col]); changed = true; } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); changed |= EditorGUIUtil.Vector2Field("Relative Offset", ref attach.anchor.relativeOffset); int pixelOffsetX = 0; int pixelOffsetY = 0; if (attach.anchor != null) { pixelOffsetX = (int)attach.anchor.pixelOffset.x; pixelOffsetY = (int)attach.anchor.pixelOffset.y; } if (EditorGUIUtil.IntField("Pixel Offset X", ref pixelOffsetX) || EditorGUIUtil.IntField("Pixel Offset Y", ref pixelOffsetY)) { attach.anchor.pixelOffset = new Vector2(pixelOffsetX, pixelOffsetY); changed = true; } if (changed) { EditorUtil.SetDirty(attach.anchor); EditorUtil.SetDirty(attach.pivot); EditorUtil.SetDirty(attach); } } } }
private bool DrawTest() { showTest = EditorGUILayout.Foldout(showTest, "Test"); bool changed = false; if (showTest) { EditorGUI.indentLevel += 2; EditorGUIUtil.ObjectField <UIFont>("Font", ref testFont, true); int row = grid.rowCount; int col = grid.columnCount; if (EditorGUIUtil.IntField("Font Size", ref fontSize, GUILayout.ExpandWidth(false))) { for (int r = 0; r < row; r++) { for (int c = 0; c < col; c++) { UILabel label = grid.GetCell(r, c).GetComponent <UILabel>(); if (label != null) { label.transform.localScale = new Vector3(fontSize, fontSize, 1); } } } } if (EditorGUIUtil.ColorField("Font Color", ref fontColor, GUILayout.ExpandWidth(false))) { for (int r = grid.rowHeader; r < row; r++) { for (int c = grid.columnHeader; c < col; c++) { UILabel label = grid.GetCell(r, c).GetComponent <UILabel>(); if (label != null) { label.color = fontColor; label.MarkAsChanged(); } } } } Array.Resize(ref testStrings, grid.maxPerLine); for (int i = 0; i < grid.maxPerLine; i++) { EditorGUIUtil.TextField(i.ToString(), ref testStrings[i], GUILayout.ExpandWidth(false)); } GUI.enabled = testFont != null; if (GUILayout.Button("Fill Data")) { for (int r = grid.rowHeader; r < row; r++) { for (int c = grid.columnHeader; c < col; c++) { UITableCell cell = grid.GetCell(r, c); if (cell == null) { UILabel label = NGUITools.AddWidget <UILabel>(grid.gameObject); label.bitmapFont = testFont; label.name = "__TEST__"; label.SetText(testStrings[grid.isHorizontal?c:r]); label.transform.localScale = new Vector3(fontSize, fontSize, 1); label.color = fontColor; label.MarkAsChanged(); UILabelCell lc = label.gameObject.AddComponent <UILabelCell>(); lc.label = label; grid.SetCell(r, c, lc); } } } changed = true; } GUI.enabled = true; EditorGUI.indentLevel -= 2; } return(changed); }
public override void OnHeaderGUI() { Validate(); EditorGUILayout.BeginHorizontal(); if (EditorGUIUtil.ObjectField <GameObject>("Root", ref root, true)) { Refresh(); } GUI.enabled = root != null; if (GUILayout.Button("Refresh", GUILayout.ExpandWidth(false))) { Refresh(); } GUI.enabled = true; EditorGUILayout.EndHorizontal(); UIPanel[] panels = root != null?root.GetComponentsInChildren <UIPanel>(true) : new UIPanel[0]; EditorGUILayout.BeginHorizontal(); if (EditorGUIUtil.PopupNullable("Panel", ref panelSel, panels, ObjToString.DefaultToString)) { Refresh(); if (panelSel != null) { EditorGUIUtility.PingObject(panelSel); Selection.activeGameObject = panelSel.gameObject; } } EditorGUIUtil.Toggle("Show Active Only", ref showActiveOnly); EditorGUILayout.EndHorizontal(); UIAtlas[] atlases = GetAtlases(widgets); UIFont[] fonts = GetFonts(widgets); if (EditorGUIUtil.PopupNullable("Select Atlas", ref atlasSel, atlases, ObjToString.DefaultToString)) { if (atlasSel != null) { fontSel = null; } } if (EditorGUIUtil.PopupNullable("Select Font", ref fontSel, fonts, ObjToString.DefaultToString)) { if (fontSel != null) { atlasSel = null; } } EditorGUILayout.BeginHorizontal(); int index = Array.FindIndex(widgets, w => w.gameObject == Selection.activeGameObject); GUI.enabled = index >= 0; if (GUI.enabled) { if (GUILayout.Button("+1 over selection")) { for (int i = 0; i <= index; ++i) { widgets[i].depth = widgets[i].depth + 1; CompatibilityEditor.SetDirty(widgets[i]); } } if (GUILayout.Button("-1 under selection")) { for (int i = index; i < widgets.Length; ++i) { widgets[i].depth = widgets[i].depth - 1; CompatibilityEditor.SetDirty(widgets[i]); } } // TODOM key handling var e = Event.current; if (e.type == EventType.KeyUp) { if (e.keyCode == KeyCode.UpArrow) { index--; if (index >= 0) { Select(widgets[index]); } } else if (e.keyCode == KeyCode.DownArrow) { index++; if (index < widgets.Length) { Select(widgets[index]); } } } } GUI.enabled = true; EditorGUILayout.EndHorizontal(); }
public bool OnInspectorGUI() { bool changed = tabArrInspector.OnInspectorGUI(); changed |= tabPrefabArrInspector.OnInspectorGUI(); if (tabPrefabArrInspector.Length > 0) { changed |= tabButtonArrInspector.Draw(); } if (GUILayout.Button("Reallocate")) { tabHandler.tabs = new UITab[0]; foreach (UITab t in tabHandler.GetComponentsInChildren <UITab>(true)) { tabHandler.tabs = tabHandler.tabs.Add(t); OnTabChanged(t, 0); } EditorUtil.SetDirty(tabHandler); // for (int i=0; i<tabHandler.tabs.Length; ++i) { // UITab t = tabHandler.tabs[i]; // OnTabRemoved(t, 0); // OnTabChanged(t, 0); // } } EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField <UIButton>(ref button, true); EditorGUILayout.EndHorizontal(); foreach (UITab t in tabHandler.tabs) { if (t != null) { if (t.tabButton == null) { EditorGUILayout.HelpBox(t.name + " Tab Button is null", MessageType.Error); } if (t.uiRoot == null) { EditorGUILayout.HelpBox(t.name + " Tab Root is null", MessageType.Error); } } } HashSet <GameObject> activeTabs = new HashSet <GameObject>(); foreach (UITab t in tabHandler.tabs) { if (t != null && t.IsVisible()) { activeTabs.Add(t.uiRoot); } } if (activeTabs.Count > 1) { EditorGUILayout.HelpBox("Multiple Tabs are activated", MessageType.Error); if (GUILayout.Button("Fix")) { tabHandler.Init(tabHandler); foreach (UITab t in tabHandler.tabs) { if (t != null) { EditorUtil.SetDirty(t.uiRoot); } } } } return(changed); }
public override void OnInspectorGUI() { if (EditorUI.DrawHeader("Sprite -> Texture")) { EditorUI.BeginContents(); EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField <Object>("Folder", ref texFolder, false); if (GUILayout.Button("Sprite -> Texture") && EditorUtility.DisplayDialog("Warning", "BackUp?", "OK", "Cancel")) { ConvertToTexture(texFolder); } EditorGUILayout.EndHorizontal(); EditorGUIUtil.ObjectFieldReorderList(texList); EditorUI.EndContents(); } if (EditorUI.DrawHeader("Texture -> Sprite")) { EditorUI.BeginContents(); EditorGUILayout.BeginHorizontal(); ComponentSelector.Draw <UIAtlas>("Atlas", atlasToAdd, OnSelectAtlas, true, GUILayout.MinWidth(80f)); if (GUILayout.Button("Add Selected")) { foreach (Object o in Selection.objects) { if (o is GameObject) { OnSelectAtlas((o as GameObject).GetComponent <UIAtlas>()); } } } EditorGUILayout.EndHorizontal(); EditorGUIUtil.TextField("Search sprite", ref searchSpriteName); if (searchSpriteName.IsNotEmpty()) { List <UIAtlas> filtered = new List <UIAtlas>(); foreach (UIAtlas a in atlasRefs) { if (a.GetSprite(searchSpriteName) != null) { filtered.Add(a); } } EditorGUIUtil.ObjectFieldReorderList(filtered); EditorGUILayout.BeginHorizontal(); EditorGUIUtil.Popup("Change to", ref changeAtlas, filtered); if (GUILayout.Button("Apply")) { BuildScript.ForEachPrefab((path, prefab) => { ChangeAtlas(prefab, filtered, changeAtlas); return(null); }); BuildScript.ForEachScene(list => { foreach (Transform t in list) { ChangeAtlas(t.gameObject, filtered, changeAtlas); } return(null); }); } EditorGUILayout.EndHorizontal(); EditorGUIUtil.ObjectFieldReorderList(spriteList); } else { if (EditorGUIUtil.ObjectFieldReorderList(atlasRefs)) { SaveAtlasRefs(); } } if (dupSprites.IsNotEmpty()) { if (EditorUI.DrawHeader("Duplicate sprites")) { EditorUI.BeginContents(); float cellWidth = 200f; float width = GetWidth(); int column = Mathf.Max((int)(width / cellWidth), 1); int i = 0; foreach (string d in dupSprites) { if (i == 0) { EditorGUILayout.BeginHorizontal(); } if (GUILayout.Button(d, GUILayout.Width(200))) { searchSpriteName = d; } i = i + 1; if (i == column) { EditorGUILayout.EndHorizontal(); i = 0; } } if (i != 0) { EditorGUILayout.EndHorizontal(); } EditorUI.EndContents(); } } EditorGUILayout.BeginHorizontal(); EditorGUIUtil.ObjectField("Target", ref targetObj, true); GUI.enabled = targetObj != null; if (GUILayout.Button("Convert to Sprite") && EditorUtility.DisplayDialog("Warning", "BackUp?", "OK")) { ConvertToSprite(); } if (GUILayout.Button("Set TexSetter")) { foreach (UITexture tex in targetObj.GetComponentsInChildren <UITexture>(true)) { TexSetterInspector.SetIfCdn(tex); } } GUI.enabled = true; EditorGUILayout.EndHorizontal(); // collect atlas GUI.enabled = targetObj != null; if (EditorUI.DrawHeader("Member Atlases")) { EditorUI.BeginContents(); if (targetObj != null) { MultiMap <UIAtlas, UISprite> collect = new MultiMap <UIAtlas, UISprite>(); foreach (UISprite s in targetObj.GetComponentsInChildren <UISprite>(true)) { collect.Add(s.atlas, s); } foreach (KeyValuePair <UIAtlas, List <UISprite> > pair in collect) { if (EditorGUILayout.Foldout(folding.Contains(pair.Key), pair.Key.name)) { folding.Add(pair.Key); EditorGUI.indentLevel++; foreach (UISprite s in pair.Value) { EditorGUILayout.ObjectField(s.gameObject, typeof(GameObject), true); } EditorGUI.indentLevel--; } else { folding.Remove(pair.Key); } } } EditorUI.EndContents(); } if (EditorUI.DrawHeader("Orphan Texture")) { EditorUI.BeginContents(); if (targetObj != null) { foreach (UITexture tex in targetObj.GetComponentsInChildren <UITexture>(true)) { if (tex.GetComponent <TexLoader>() == null) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.ObjectField(tex.gameObject, typeof(GameObject), true); EditorGUILayout.ObjectField(tex.mainTexture, typeof(Texture), false); EditorGUILayout.EndHorizontal(); } } } EditorUI.EndContents(); } GUI.enabled = true; EditorUI.EndContents(); } if (EditorUI.DrawHeader("Find All Sprites")) { EditorUI.BeginContents(); EditorGUILayout.BeginHorizontal(); ComponentSelector.Draw <UIAtlas>("Atlas", atlas4Sprite, OnSelectAtlasForSprite, true, GUILayout.MinWidth(80f)); if (GUILayout.Button("Find")) { var list = Resources.FindObjectsOfTypeAll <UISprite>().ToList(i => i as UISprite); s4a.Clear(); foreach (var s in list) { if (s.atlas == atlas4Sprite) { s4a.Add(s); } } } EditorGUILayout.EndHorizontal(); EditorUI.EndContents(); } GUI.enabled = true; }