Merge tree2 UI improvements with equipment and safe case integration

This commit is contained in:
2026-11-12 18:23:59 +08:00
64 changed files with 3236 additions and 63 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.IO;
using UnityEngine;
namespace Ironspore
{
public static class GameDataPaths
{
public static string DirectoryPath
{
get
{
string isolated = CommandLineDirectory();
if (isolated != null)
return isolated;
#if UNITY_EDITOR
return Path.GetFullPath(Path.Combine(Application.dataPath, "../UserSettings/Ironspore"));
#else
return Path.Combine(Application.persistentDataPath, "Ironspore");
#endif
}
}
public static string PreferenceKey(string key)
{
string isolated = CommandLineDirectory();
#if UNITY_EDITOR
isolated = isolated ?? DirectoryPath;
#endif
return isolated == null ? key : "ironspore." + Hash128.Compute(isolated.ToLowerInvariant()) + "." + key;
}
static string CommandLineDirectory()
{
string[] args = Environment.GetCommandLineArgs();
for (int i = 0; i + 1 < args.Length; i++)
if (args[i] == "-ironspore-data-path" && Path.IsPathRooted(args[i + 1]))
return Path.GetFullPath(args[i + 1]);
return null;
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 519f858dabbde1042a2c7fba13058b93
+1 -6
View File
@@ -78,12 +78,7 @@ namespace Ironspore
public static string SavePath(bool trial)
{
#if UNITY_EDITOR
string root = Path.Combine(Path.GetDirectoryName(Application.dataPath), "UserSettings");
#else
string root = Application.persistentDataPath;
#endif
return Path.Combine(root, "Ironspore", trial ? "range-v2.json" : "profile-v2.json");
return Path.Combine(GameDataPaths.DirectoryPath, trial ? "range-v2.json" : "profile-v2.json");
}
public ProfileStore(string savePath)