internal void Draw(UICore core) { _target = core; string s; GUIContent c; if (core.prefab) { s = AssetDatabase.GetAssetPath(core.prefab); c = new GUIContent(EditorFileTools.GetFileName(s), s); } else { c = new GUIContent("none"); } GUILayout.BeginHorizontal(); GUILayout.Label("prefab", GUILayout.Width(60)); if (GUILayout.Button(c, "textfield", GUILayout.MaxWidth(150))) { ShowFilter(); } if (Event.current.type == EventType.Repaint) { _pos = GUILayoutUtility.GetLastRect(); } if (GUILayout.Button("", "IN ObjectField", GUILayout.MinWidth(18), GUILayout.MaxWidth(18f))) { ShowFilter(); } UpdateDragAction(); GUILayout.EndHorizontal(); }
private void DoCreate() { if (_sceneAsset == null) { EditorUtility.DisplayDialog("warning", "没有选中场景", "OK"); return; } string p = AssetDatabase.GetAssetPath(_sceneAsset); if (!p.Contains("_output")) { EditorUtility.DisplayDialog("warning", "只有包含_output的场景才是可引用场景", "OK"); return; } string sceneName = EditorFileTools.GetFileName(p); if (File.Exists(p) == false) { EditorUtility.DisplayDialog("warning", sceneName + " not exported yet!", "OK"); return; } if (string.IsNullOrEmpty(_placeName)) { EditorUtility.DisplayDialog("warning", "place name is needed", "OK"); return; } string placeFolder = PlaceCenter.SOURCE + "/" + _placeName; if (Directory.Exists(placeFolder)) { EditorUtility.DisplayDialog("warning", _placeName + " 已经存在!!!", "OK"); return; } string sceneFile = AssetDatabase.GetAssetPath(_sceneAsset); string nav = EditorFileTools.GetFolder(sceneFile); nav += "/" + "nav.bin"; if (!File.Exists(nav)) { EditorUtility.DisplayDialog("warning", string.Format("{0} 没有NavMesh,联系美术", sceneName), "OK"); } else { new CreatePlaceCommand(sceneFile, _placeName).Execute(); Close(); } }