From 4b7b22aad4d2d59d717b6ab8666d49846412ae9b Mon Sep 17 00:00:00 2001 From: anavoi Date: Sat, 12 Jul 2025 23:33:41 +0200 Subject: [PATCH] feat: create config folder at runtime --- Addons/Helper.cs | 14 ++++++++++++++ Plugin.cs | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/Addons/Helper.cs b/Addons/Helper.cs index d53cef5..b674c1c 100644 --- a/Addons/Helper.cs +++ b/Addons/Helper.cs @@ -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); + } + } } \ No newline at end of file diff --git a/Plugin.cs b/Plugin.cs index 81e98a0..ac523ee 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -49,6 +49,11 @@ public class Plugin : BaseUnityPlugin GBSUCompInit(); Helper.DisableAnalytics(); // thank me later + + // create server config path + Helper.CreateRotationFolder(); + + Log.LogDebug("Server game config should be found at " + Helper.GameConfigPath); } private static void GBSUCompInit()