add the connections and sendToTest.cs for connecting with the game test

This commit is contained in:
FloatGaming
2025-11-03 16:14:30 +08:00
parent 4ebe6183d3
commit 7837c6adf0
22 changed files with 5552 additions and 324 deletions
@@ -9,8 +9,8 @@ public class Notes : MonoBehaviour
private void Update()
{
// 过了 Miss 判定时间,销毁音符
if (!isHit && Time.timeSinceLevelLoad > hitTime + 0.3f)
// 只有进入判定区后,才允许自动miss
if (canBeJudged && !isHit && Time.timeSinceLevelLoad > hitTime + 0.3f)
{
JudgeMiss();
}
@@ -57,31 +57,44 @@ public class Notes : MonoBehaviour
}
}
private void Recycle()
{
// 如果存在 NotePool,优先归还池,否则销毁物体
if (NotePool.Instance != null)
{
NotePool.Instance.ReturnNote(gameObject, "red"); // color 未保存时默认 red,建议上层调用时传入
}
else
{
Destroy(gameObject);
}
}
private void JudgePerfect()
{
Debug.Log($"Track {trackIndex}: Perfect!");
isHit = true;
Destroy(gameObject);
Recycle();
}
private void JudgeGreat()
{
Debug.Log($"Track {trackIndex}: Great!");
isHit = true;
Destroy(gameObject);
Recycle();
}
private void JudgeGood()
{
Debug.Log($"Track {trackIndex}: Good!");
isHit = true;
Destroy(gameObject);
Recycle();
}
private void JudgeMiss()
{
Debug.Log($"Track {trackIndex}: Miss!");
isHit = true;
Destroy(gameObject);
Recycle();
}
}