Пример #1
0
        void OnGUI()
        {
            DesignPreviewEditorDisplay previewDisplay = new DesignPreviewEditorDisplay(previewer);
            var finalTable = previewDisplay.ShowEditorPreview();

            EditorGUILayout.LabelField("Save:", EditorStyles.boldLabel);
            ShowFileSelections();
            EditorGUILayout.Space();
            if (GUILayout.Button("Save"))
            {
                string fileNameWithExtension = fileName + ".csv";
                string path = Path.Combine(folder, fileNameWithExtension);
                File.WriteAllText(path, finalTable.AsString(truncateLength: -1, separator: Delimiter.Comma));
                Close();
            }
        }
Пример #2
0
        void OnGUI()
        {
            if (previewer != null)
            {
                DesignPreviewEditorDisplay previewDisplay = new DesignPreviewEditorDisplay(previewer);

                scrollPos = EditorGUILayout.BeginScrollView(scrollPos,
                                                            false, false,
                                                            GUILayout.ExpandHeight(true));

                previewDisplay.ShowEditorPreview();

                EditorGUILayout.EndScrollView();
            }
            else
            {
                EditorGUILayout.HelpBox("Nothing to preview. Make sure a design file is selected and it has no errors.", MessageType.Error);
            }
        }