private void ShowSaveLocation() { if (place.DataStructure.SaveSearch.Count > 0) { GUILayout.BeginHorizontal("Box"); show = EditorGUILayout.Foldout(show, "SAVED LOCATION"); GUILayout.EndHorizontal(); if (show) { GUILayout.BeginVertical("Box"); foreach (SearchData seachData in place.DataStructure.SaveSearch) { GUILayout.BeginHorizontal(); if (GUILayout.Button(seachData.label, "CN CountBadge")) { place.SetupToTileManager(seachData.coordinates[1], seachData.coordinates[0]); } if (GUILayout.Button("\u2718", "CN CountBadge", GUILayout.MaxWidth(25))) { place.DataStructure.SaveSearch.Remove(seachData); return; } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); } } }
public override void OnInspectorGUI() { // DrawDefaultInspector(); place = target as SearchPlace; if (place != null) { place.namePlace = EditorGUILayout.TextField("NamePlace", place.namePlace); if (place.namePlace == String.Empty) { place.namePlaceСache = ""; place.dataList.Clear(); EditorGUILayout.HelpBox("Enter place name", MessageType.Info); } else { place.SearchInMapzen(); } int fl = 0; if (place.dataList != null) { for (int i = 0; i < place.dataList.Count; i++) { var style = new GUIStyle(GUI.skin.button); style.normal.textColor = Color.black; style.alignment = TextAnchor.MiddleLeft; style.fixedWidth = Screen.width - 40; if (GUILayout.Button(place.dataList[i].label, style, GUILayout.Height(20))) { place.SetupToTileManager(place.dataList[i].coordinates[1], place.dataList[i].coordinates[0]); } } } } Repaint(); }