using System; using UnityEngine; // config_N.json 的內容 : 當下完整的 GameSettings + 這一回合的資訊 // 直接繼承 GameSettings,之後 StartUI 多了什麼設定,這裡會自動跟著記錄 [Serializable] public class RoundConfig : GameSettings { // 回合資訊 (時間都是 Time.realtimeSinceStartupAsDouble 時間軸,跟 CSV 一致) public int roundIndex; public string startTimeLocal; // 開始的實際時間 (ISO 8601) public double startTime; public double endTime; public double duration; public double pausedSeconds; // 摘要 public int shots; public int hits; public int mouseEvents; public int frames; // 重現與分析用 public int recoilSeed; public float cameraVerticalFov; public float fixedDeltaTime; public string appVersion; public string unityVersion; public static RoundConfig Create(int index) { RoundConfig c = new RoundConfig(); JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(Load()), c); // 複製目前存檔的設定 c.roundIndex = index; c.startTimeLocal = DateTime.Now.ToString("o"); c.startTime = Time.realtimeSinceStartupAsDouble; c.fixedDeltaTime = Time.fixedDeltaTime; c.appVersion = Application.version; c.unityVersion = Application.unityVersion; return c; } }