add the connections and sendToTest.cs for connecting with the game test
This commit is contained in:
@@ -11,6 +11,9 @@ public class JudgeManager : MonoBehaviour
|
||||
// 记录 End 段的 scheduledEndTime(防止 End 被回收后仍然能判定)
|
||||
private Dictionary<string, float> noteEndTimes = new Dictionary<string, float>();
|
||||
|
||||
// 记录每条长音符中段通过的计数
|
||||
private Dictionary<string, int> middlePassedCounts = new Dictionary<string, int>();
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -28,17 +31,17 @@ public class JudgeManager : MonoBehaviour
|
||||
/// <summary>
|
||||
/// 记录某个颜色的长音符 End 段的 scheduledEndTime
|
||||
/// </summary>
|
||||
public void RegisterScheduledEndTime(string noteColor, float endTime)
|
||||
public void RegisterScheduledEndTime(string noteID, float endTime)
|
||||
{
|
||||
noteEndTimes[noteColor] = endTime;
|
||||
noteEndTimes[noteID] = endTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取某个颜色的 End 段的 scheduledEndTime
|
||||
/// </summary>
|
||||
public float GetScheduledEndTime(string noteColor)
|
||||
public float GetScheduledEndTime(string noteID)
|
||||
{
|
||||
return noteEndTimes.ContainsKey(noteColor) ? noteEndTimes[noteColor] : 0f;
|
||||
return noteEndTimes.ContainsKey(noteID) ? noteEndTimes[noteID] : 0f;
|
||||
}
|
||||
|
||||
public void RegisterStartJudged(string noteID, bool state)
|
||||
@@ -117,4 +120,28 @@ public class JudgeManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记录中段通过,用于调试或进一步判定策略
|
||||
/// </summary>
|
||||
public void RegisterMiddlePassed(string noteID)
|
||||
{
|
||||
if (!middlePassedCounts.ContainsKey(noteID))
|
||||
middlePassedCounts[noteID] = 0;
|
||||
middlePassedCounts[noteID]++;
|
||||
Debug.Log($"[JudgeManager] Middle passed for {noteID}, total={middlePassedCounts[noteID]}");
|
||||
}
|
||||
|
||||
public int GetMiddlePassedCount(string noteID)
|
||||
{
|
||||
return middlePassedCounts.ContainsKey(noteID) ? middlePassedCounts[noteID] : 0;
|
||||
}
|
||||
|
||||
public void ClearNoteRecord(string noteID)
|
||||
{
|
||||
if (startJudgedNotes.ContainsKey(noteID)) startJudgedNotes.Remove(noteID);
|
||||
if (releasedNotes.ContainsKey(noteID)) releasedNotes.Remove(noteID);
|
||||
if (noteEndTimes.ContainsKey(noteID)) noteEndTimes.Remove(noteID);
|
||||
if (middlePassedCounts.ContainsKey(noteID)) middlePassedCounts.Remove(noteID);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user