protected override void CustomOnGUI() { EditorUIHelper.BeginHorizontal(); { _curModelType = EditorUIHelper.EnumPopup <ModelType>(_curModelType); if (GUI.changed) { Refresh(); } EditorUIHelper.Button("刷新", Refresh); } EditorUIHelper.EndHorizontal(); EditorUIHelper.Space(); _search = EditorUIHelper.SearchCancelTextField(_search); EditorUIHelper.Space(); _scroll = EditorUIHelper.BeginScrollView(_scroll); { for (int i = 0; i < _models.Count; i++) { var importer = _modelImporters[i]; var model = _models[i]; if (!string.IsNullOrEmpty(_search)) { if (!model.name.Contains(_search)) { continue; } } EditorUIHelper.DrawLine(); EditorUIHelper.BeginHorizontal(); { EditorUIHelper.ObjectField(model); EditorUIHelper.Toggle("绑点优化状态", importer.animationType == ModelImporterAnimationType.Generic && importer.optimizeGameObjects); EditorUIHelper.Button("优化绑点", () => EditorHelper.Run(() => ModelOptimizeHelper.OptimizeGameObject(importer))); EditorUIHelper.Button("还原绑点", () => EditorHelper.Run(() => ModelOptimizeHelper.RevertOptimizeGameObject(importer))); } EditorUIHelper.EndHorizontal(); } } EditorUIHelper.EndScrollView(); }
protected override void CustomOnGUI() { if (_msg != null) { EditorUIHelper.TitleField(_msg); EditorUIHelper.Space(); } _search = EditorUIHelper.SearchCancelTextField(_search); _searchFilter = EditorUIHelper.EnumPopup <EditorAssetHelper.SearchFilter>(_searchFilter, "SearchFilter"); EditorUIHelper.TitleField("数量:", (_goList != null ? _goList.Count : 0).ToString()); EditorUIHelper.Space(); _ListScroll = EditorUIHelper.BeginScrollView(_ListScroll); { var count = _goList != null ? _goList.Count : 0; var needSearch = !string.IsNullOrEmpty(_search); for (int i = 0; i < count; i++) { var go = _goList[i]; if (needSearch && !go.name.Contains(_search)) { continue; } if (!EditorAssetHelper.IsMatch(go, _searchFilter)) { continue; } EditorUIHelper.DrawLine(); EditorUIHelper.BeginHorizontal(); { EditorUIHelper.ObjectField(go, null, string.Empty, true); EditorUIHelper.Button("选中", () => EditorAssetHelper.SelectObject(go)); var index = i; EditorUIHelper.Button("移除", () => RemoveGo(index)); } EditorUIHelper.EndHorizontal(); } } EditorUIHelper.EndScrollView(); }
protected override void CustomOnGUI() { _searchText = EditorUIHelper.SearchCancelTextField(_searchText); EditorUIHelper.Space(); EditorUIHelper.Button("InstanceID", () => { int id; if (int.TryParse(_searchText, out id)) { EditorAssetHelper.SelectObject(EditorUtility.InstanceIDToObject(id)); } }); EditorUIHelper.Space(); EditorUIHelper.Button("GUID", () => { EditorAssetHelper.SelectObject(EditorAssetHelper.GUIDToObject(_searchText)); }); }
private void OnGUIEditor() { EditorGUILayout.Space(); GUILayout.BeginHorizontal(); if (GUILayout.Button("LogAssetBundlePath", GUILayout.MaxWidth(150))) { LogSearchAssetBundlePath(false); } if (GUILayout.Button("LogAllAssetBundlePath", GUILayout.MaxWidth(200))) { LogSearchAssetBundlePath(true); } SearchText = EditorUIHelper.SearchCancelTextField(SearchText); GUILayout.EndHorizontal(); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Add File", GUILayout.MaxWidth(75f))) { BrowseForFile(); } if (GUILayout.Button("Add Folder", GUILayout.MaxWidth(75f))) { BrowseForFolder(); } GUILayout.EndHorizontal(); EditorGUILayout.Space(); if (m_BundleList.Count > 0) { int halfWidth = (int)(m_Position.width / 2.0f); var height = 60; m_BundleTreeView.OnGUI(new Rect(m_Position.x, m_Position.y + height, halfWidth, m_Position.height - height)); m_SingleInspector.OnGUI(new Rect(m_Position.x + halfWidth, m_Position.y + height, halfWidth, m_Position.height - height)); } }
protected override void CustomOnGUI() { EditorUIHelper.BeginChangeCheck(); { _selectedIndex = EditorUIHelper.Popup("类型:", _selectedIndex, AssetImporterTypeStrs); } if (EditorUIHelper.EndChangeCheck()) { ClearData(); } var op = Operator; if (op != null) { EditorUIHelper.Space(); EditorUIHelper.BeginHorizontal(); { _showTypeIndex = EditorUIHelper.Toolbar(_showTypeIndex, _showTypes); } EditorUIHelper.EndHorizontal(); EditorUIHelper.Space(); EditorUIHelper.BeginChangeCheck(); { _searchText = EditorUIHelper.SearchCancelTextField(_searchText); } if (EditorUIHelper.EndChangeCheck()) { ClearData(); } EditorUIHelper.Space(); _showTypeScroll = EditorUIHelper.BeginScrollView(_showTypeScroll); { ShowTypePanel(); } EditorUIHelper.EndScrollView(); } }
protected override void CustomOnGUI() { EditorUIHelper.BeginHorizontal(); { _searchType = EditorUIHelper.SearchCancelTextField(_searchType); EditorUIHelper.Button("Caculate", Calculate); EditorUIHelper.Button("CaculateAll", CaulateAll); } EditorUIHelper.EndHorizontal(); _scroll = EditorUIHelper.BeginScrollView(_scroll); { foreach (var keyValue in _monoFieldDict) { EditorUIHelper.DrawLine(); EditorUIHelper.TextField("Type:", keyValue.Key); foreach (var method in keyValue.Value) { EditorUIHelper.TextField("Field:", method); } } EditorUIHelper.Space(); foreach (var keyValue in _monoMethodDict) { EditorUIHelper.DrawLine(); EditorUIHelper.TextField("Type:", keyValue.Key); foreach (var method in keyValue.Value) { EditorUIHelper.TextField("Method:", method); } } } EditorUIHelper.EndScrollView(); }