Firstborn/Library/PackageCache/com.unity.visualscripting@1.../Editor/SettingsProvider/ProjectSettings/BackupSettings.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

47 lines
1.2 KiB
C#

using System.Diagnostics;
using UnityEditor;
using UnityEngine;
namespace Unity.VisualScripting
{
public class BackupSettings
{
private const string Title = "Backup Graphs";
private const string ButtonBackupLabel = "Create Backup";
private const string ButtonRestoreLabel = "Restore Backup";
public void OnGUI()
{
GUILayout.Space(5f);
GUILayout.Label(Title, EditorStyles.boldLabel);
GUILayout.Space(5f);
if (GUILayout.Button(ButtonBackupLabel, Styles.defaultsButton))
{
VSBackupUtility.Backup();
EditorUtility.DisplayDialog("Backup", "Backup completed successfully.", "OK");
}
if (GUILayout.Button(ButtonRestoreLabel, Styles.defaultsButton))
{
PathUtility.CreateDirectoryIfNeeded(Paths.backups);
Process.Start(Paths.backups);
}
}
private static class Styles
{
static Styles()
{
defaultsButton = new GUIStyle("Button");
defaultsButton.padding = new RectOffset(10, 10, 4, 4);
}
public static readonly GUIStyle defaultsButton;
}
}
}