forked from tertle/com.bovinelabs.analyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtil.cs
38 lines (31 loc) · 1010 Bytes
/
Util.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// <copyright file="Util.cs" company="Timothy Raines">
// Copyright (c) Timothy Raines. All rights reserved.
// </copyright>
namespace BovineLabs.Analyzers
{
using System.IO;
using UnityEditor;
/// <summary>
/// The Util.
/// </summary>
public static class Util
{
private const string DirectoryKey = "BovineLabs.Analyzers.Directory";
private const string DefaultDirectory = "RoslynAnalyzers";
public static string GetDirectory()
{
return EditorPrefs.GetString(DirectoryKey, DefaultDirectory);
}
public static void SetDirectory(string directory)
{
EditorPrefs.SetString(DirectoryKey, directory);
}
public static string GetCreateDirectory()
{
var directory = GetDirectory();
var fullDir = Path.Combine(Directory.GetCurrentDirectory(), directory);
Directory.CreateDirectory(fullDir);
return directory;
}
}
}