Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit 113a931

Browse files
Multi Records Allowed and Camera Locked (#221)
2 parents 912cfd4 + 2bacba7 commit 113a931

File tree

4 files changed

+60
-23
lines changed

4 files changed

+60
-23
lines changed

client/unity/Assets/Resources/Fonts/方正卡通简体 SDF 1.asset

Lines changed: 45 additions & 14 deletions
Large diffs are not rendered by default.

client/unity/Assets/Scripts/Scene/CameraController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void Start()
7272
});
7373
TypeEventSystem.Global.Register<BattleEndEvent>(e =>
7474
{
75-
ResetCamera();
75+
//ResetCamera();
7676
});
7777
LockButton.onClick.AddListener(LockStatus);
7878
}

client/unity/Assets/Scripts/Utility/JsonUtility.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading.Tasks;
88
using UnityEditor;
99
using UnityEngine;
10+
using static UnityEngine.EventSystems.EventTrigger;
1011

1112
public static class JsonUtility
1213
{
@@ -70,29 +71,34 @@ private static List<JObject> ProcessZipArchive(string path, IProgress<float> pro
7071
e.Length > 0
7172
).ToList();
7273

74+
int completed = 0;
7375
var result = new List<JObject>(entries.Count);
74-
75-
// 调整并行度为物理核心数
76-
Parallel.ForEach(entries, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount }, (entry, state, index) =>
76+
object target_obj = new();
77+
foreach (var entry in entries)
7778
{
79+
if (Path.GetExtension(entry.FullName).ToLower() != ".json")
80+
{
81+
continue;
82+
}
7883
try
7984
{
8085
using var stream = entry.Open();
8186
using var reader = new StreamReader(stream);
8287
var json = reader.ReadToEnd();
8388
if (JObject.Parse(json) is JObject obj)
84-
lock (result) { result.Add(obj); }
89+
{
90+
result.Add(obj);
91+
}
8592

8693
// 更新进度
87-
float progressValue = (float)(index + 1) / entries.Count;
94+
float progressValue = (float)(++completed) / entries.Count;
8895
progress?.Report(progressValue);
8996
}
9097
catch (Exception ex)
9198
{
9299
Debug.LogWarning($"Failed to process {entry.FullName}: {ex.Message}");
93100
}
94-
});
95-
101+
};
96102
return result;
97103
}
98104

server/src/Recorder/Recorder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Thuai.Server.Recorder;
77

88
public partial class Recorder : IDisposable
99
{
10-
public const int MaxRecordsBeforeSave = 100_000;
10+
public const int MaxRecordsBeforeSave = 1000;
1111

1212
public required bool KeepRecord { get; init; }
1313

0 commit comments

Comments
 (0)