void DrawContent(AssetBundleFilter filter) { if (!filter.isAppend || filter.independent) { filter.assetbundleName = GUILayout.TextField(filter.assetbundleName, GUILayout.MinWidth(120), GUILayout.MaxWidth(240)); } filter.pattern = GUILayout.TextField(filter.pattern, GUILayout.MinWidth(120), GUILayout.MaxWidth(320)); filter.resType = (GameResType)EditorGUILayout.EnumPopup(filter.resType, GUILayout.MinWidth(80), GUILayout.MaxWidth(120), GUILayout.ExpandWidth(false)); if (!filter.isAppend || filter.independent) { filter.option = (BuildOption)EditorGUILayout.EnumPopup(filter.option, GUILayout.MinWidth(80), GUILayout.MaxWidth(120), GUILayout.ExpandWidth(false)); } }
void OnFileListElementGUI(Rect rect, int index, bool isactive, bool isfocused) { const float GAP = 5; AssetBundleFilter file = _config.files[index]; rect.y++; Rect r = rect; r.width = 16; r.height = 18; file.valid = GUI.Toggle(r, file.valid, GUIContent.none); r.xMin = r.xMax + GAP; r.xMax = rect.xMax - 300; GUI.enabled = false; file.path = GUI.TextField(r, file.path); GUI.enabled = true; r.xMin = r.xMax + GAP; r.width = 50; if (GUI.Button(r, "Select")) { string dataPath = Application.dataPath; string selectedPath = EditorUtility.OpenFilePanel("Path", dataPath, ""); if (!string.IsNullOrEmpty(selectedPath)) { if (selectedPath.StartsWith(dataPath)) { file.path = "Assets/" + selectedPath.Substring(dataPath.Length + 1); } else { ShowNotification(new GUIContent("不能在Assets目录之外!")); } } } r.xMin = r.xMax + GAP; r.xMax = rect.xMax; file.filter = GUI.TextField(r, file.filter); }