public override void OnInspectorGUI() { // DrawDefaultInspector(); place = target as SearchPlace; if (place != null) { GUILayout.BeginHorizontal("Box"); GUILayout.Label("Enter location name", LayerSettingWindows.GuiTitleSize(14, TextAnchor.MiddleCenter, Color.black)); place.namePlace = EditorGUILayout.TextField("", place.namePlace, GUILayout.Height(20)); GUILayout.EndHorizontal(); // Debug.Log(place.namePlace == String.Empty); if (place.namePlace == String.Empty) { place.namePlaceСache = ""; place.DataStructure.dataChache.Clear(); EditorGUILayout.HelpBox("Enter place name", MessageType.Info); } else { place.SearchInMapzen(); } if (place.DataStructure.dataChache != null) { EditorGUILayout.Separator(); ShowSaveLocation(); EditorGUILayout.Separator(); ShowFoundLocation(); } } Repaint(); }
/* --------------------------------------- * PerformSearch: Used to control the start of searches * --------------------------------------- */ private void PerformSearch() { if (address != null && address.Trim() != "" && lastSearch != address) { place.namePlace = address; place.SearchInMapzen(); lastSearch = address; } }
/* --------------------------------------- * PerformSearch: Used to control the start of searches * --------------------------------------- */ private void PerformSearch() { if (Value != null && Value.Trim() != "" && lastSearch != Value) { place.namePlace = Value; place.SearchInMapzen(); lastSearch = Value; } }
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(); }