public void Reset() { Control.Init(); // create our reorderable lists keywordList = new ReorderableList(Control.Model.keywords, typeof(List <string>), true, true, true, true); dependenciesList = new ReorderableList(Control.Model.dependencies.entries, typeof(List <PackageDependency>), true, true, true, true); // and all of the callbacks keywordList.drawHeaderCallback += KeywordsHeader; keywordList.drawElementCallback += KeywordsElement; keywordList.onAddCallback += KeywordsAdd; keywordList.onRemoveCallback += KeywordsRemove; dependenciesList.drawHeaderCallback += DependenciesHeader; dependenciesList.drawElementCallback += DependenciesElement; dependenciesList.onAddCallback += DependenciesAdd; dependenciesList.onRemoveCallback += DependenciesRemove; dependenciesList.elementHeightCallback = (index) => { Repaint(); // we want the dependencies list to be double height var height = EditorGUIUtility.singleLineHeight * 2.5f; return(height); }; }
/// <summary> /// export button /// </summary> private void DrawExportButtonUI() { GUILayout.BeginHorizontal(); { if (GUILayout.Button(Loc.NEW_PACKAGE, GUILayout.Height(35f), GUILayout.ExpandWidth(true))) { Reset(); } if (GUILayout.Button(Loc.EXPORT_PACKAGE, GUILayout.Height(35f), GUILayout.ExpandWidth(true))) { Control.ExportPackage(); } } GUILayout.EndHorizontal(); // draw a log of the actions that we're taking GUILayout.BeginHorizontal(); { GUILayout.Space(5f); GUILayout.BeginHorizontal(); { outputScrollPosition = GUILayout.BeginScrollView(outputScrollPosition, GUILayout.ExpandWidth(true), GUILayout.Height(200f)); { var debugtext = Control.outputLog.ToString(); GUILayout.TextArea(debugtext, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); } GUILayout.EndScrollView(); } GUILayout.EndHorizontal(); GUILayout.Space(5f); } GUILayout.EndHorizontal(); }