feat: create config folder at runtime
This commit is contained in:
parent
05256ecd8a
commit
4b7b22aad4
2 changed files with 19 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ using UnityEngine.Analytics;
|
||||||
namespace GBSU.Addons;
|
namespace GBSU.Addons;
|
||||||
public class Helper
|
public class Helper
|
||||||
{
|
{
|
||||||
|
public static string RotationFolderPath = Application.dataPath + "/Config/Rotation/";
|
||||||
|
public static string GameConfigPath = RotationFolderPath + "config.json";
|
||||||
public static void DisableAnalytics()
|
public static void DisableAnalytics()
|
||||||
{
|
{
|
||||||
// Try disabling analytics https://docs.unity3d.com/ScriptReference/Analytics.Analytics-deviceStatsEnabled.html
|
// 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);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -49,6 +49,11 @@ public class Plugin : BaseUnityPlugin
|
||||||
GBSUCompInit();
|
GBSUCompInit();
|
||||||
|
|
||||||
Helper.DisableAnalytics(); // thank me later
|
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()
|
private static void GBSUCompInit()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue