forked from SubnauticaNitrox/Nitrox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNitroxAppData.cs
32 lines (25 loc) · 937 Bytes
/
NitroxAppData.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
using System;
using System.IO;
namespace NitroxModel.Helper
{
public class NitroxAppData
{
private static NitroxAppData instance;
private NitroxAppData()
{
Directory.CreateDirectory(RootDir);
}
public static NitroxAppData Instance => instance ?? (instance = new NitroxAppData());
private string RootDir { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Nitrox");
/// <summary>
/// Gets the launcher path from the environment variable.
/// Set by Nitrox.Bootloader.Main.
/// </summary>
public string LauncherPath => Environment.GetEnvironmentVariable("NITROX_LAUNCHER_PATH");
public string AssetsPath => Path.Combine(LauncherPath, "AssetBundles");
public static NitroxAppData Load()
{
return new NitroxAppData();
}
}
}