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() { 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(); }