feat: create config folder at runtime

This commit is contained in:
anavoi 2025-07-12 23:33:41 +02:00
commit 4b7b22aad4
2 changed files with 19 additions and 0 deletions

View file

@ -4,6 +4,8 @@ using UnityEngine.Analytics;
namespace GBSU.Addons;
public class Helper
{
public static string RotationFolderPath = Application.dataPath + "/Config/Rotation/";
public static string GameConfigPath = RotationFolderPath + "config.json";
public static void DisableAnalytics()
{
// Try disabling analytics https://docs.unity3d.com/ScriptReference/Analytics.Analytics-deviceStatsEnabled.html
@ -17,4 +19,16 @@ public class Helper
Plugin.Log.LogWarning("Failed to disable analytics: " + e.Message);
}
}
public static void CreateRotationFolder()
{
try
{
Plugin.Log.LogInfo("Creating rotation folder at " + RotationFolderPath);
Directory.CreateDirectory(RotationFolderPath);
}
catch (Exception e)
{
Plugin.Log.LogError("Could not create rotation folder path: " + e.Message);
}
}
}