private void LoadRules() { var rulesPath = EditorUtility.OpenFilePanel("", "", Constants.JsonExtension); if (String.IsNullOrWhiteSpace(rulesPath)) { return; } _activeRuleList = PrefabWizard.GetRules(rulesPath); UpdateRulesListViewContentsWithActiveRuleList(); // Update the log list _logListView.Clear(); _listEntryVisualTreeAsset.CloneTree(_logListView); _listEntryButton = _root.Q <Button>(Constants.LabelButtonLogEntry); _listEntryButton.text = Constants.MessageSuccessfullyLoadedRules + rulesPath; _logListView.Add(_listEntryButton); }
private void SaveRules() { var rulesPath = EditorUtility.SaveFilePanel( "", "", Constants.DefaultRulesFileName, Constants.JsonExtension); if (String.IsNullOrWhiteSpace(rulesPath)) { return; } UpdateActiveRuleListWithRulesListViewContents(); PrefabWizard.SetRules(_activeRuleList, rulesPath); AssetDatabase.Refresh(); // Update the log list _logListView.Clear(); _listEntryVisualTreeAsset.CloneTree(_logListView); _listEntryButton = _root.Q <Button>(Constants.LabelButtonLogEntry); _listEntryButton.text = Constants.MessageSuccessfullySavedRules + rulesPath; _logListView.Add(_listEntryButton); }