This commit is contained in:
2026-04-17 01:35:53 +05:30
parent ced9c9fa35
commit 210722a472
21 changed files with 3042 additions and 1964 deletions
+11 -4
View File
@@ -10,14 +10,21 @@ public class Logger
{
get
{
// Android (and iOS): dataPath is inside the package/APK and is not writable.
if (Application.platform == RuntimePlatform.Android ||
Application.platform == RuntimePlatform.IPhonePlayer)
{
return Application.persistentDataPath;
}
string path = Application.dataPath;
if (Application.platform == RuntimePlatform.OSXPlayer)
{
path += "/../../";
path = Path.Combine(path, "..", "..");
}
else if (Application.platform == RuntimePlatform.WindowsPlayer)
{
path += "/../";
path = Path.Combine(path, "..");
}
return path;
}
@@ -41,7 +48,7 @@ public class Logger
if(!Enabled){return;}
Debug.Log("Starting logger @ " + ApplicationDirectory);
if(LogFilePath == null){
LogFilePath = ApplicationDirectory + "Log.txt";
LogFilePath = Path.Combine(ApplicationDirectory, "Log.txt");
}
File.WriteAllText(LogFilePath, "Logger initiated at " + DateTime.Now + "\n\n");
}
@@ -58,7 +65,7 @@ public class Logger
}
public static void SetFileName(string fileName){
instance.LogFilePath = ApplicationDirectory+fileName + ".txt";
instance.LogFilePath = Path.Combine(ApplicationDirectory, fileName + ".txt");
}
public static void SetFilePath(string path){