加入很多新内容,这波一块交了
This commit is contained in:
@@ -11,6 +11,7 @@ public class Note : BaseNote
|
||||
private bool hasLock = false; // track whether we hold the track lock
|
||||
|
||||
private NoteData noteData;
|
||||
private bool isSyncNote;
|
||||
|
||||
[Header("Inspector")]
|
||||
public NoteJudgeConfig judgeConfig; // Documentation text normalized.
|
||||
@@ -42,6 +43,18 @@ public class Note : BaseNote
|
||||
return beatmapManagerCache;
|
||||
}
|
||||
|
||||
public static void PrewarmRuntimeCaches()
|
||||
{
|
||||
GetBeatmapManagerCached();
|
||||
if (allyCache == null || allyCache.Length < 10)
|
||||
allyCache = new AllyCombatant[10];
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
GetAllyForTrackCached(i);
|
||||
}
|
||||
}
|
||||
|
||||
private static float JudgeToPmMultiplier(string judgeResult)
|
||||
{
|
||||
switch (judgeResult)
|
||||
@@ -150,7 +163,7 @@ public class Note : BaseNote
|
||||
controller = GetComponent<NoteController>();
|
||||
}
|
||||
|
||||
public void Setup(KeyCode key, int trackIndex, float speed, float hitTime, string color, NoteJudgeConfig judgeConfig, NoteData data)
|
||||
public void Setup(KeyCode key, int trackIndex, float speed, float hitTime, string color, NoteJudgeConfig judgeConfig, NoteData data, bool isSync = false)
|
||||
{
|
||||
keyToPress = key;
|
||||
noteColor = color;
|
||||
@@ -161,6 +174,7 @@ public class Note : BaseNote
|
||||
hasLock = false;
|
||||
this.judgeConfig = judgeConfig;
|
||||
this.noteData = data;
|
||||
this.isSyncNote = isSync;
|
||||
|
||||
// Set miss deadline: hitTime + missRange (the latest time to judge before auto-miss)
|
||||
float missRange = (judgeConfig?.missRange ?? 0.5f);
|
||||
@@ -279,6 +293,13 @@ public class Note : BaseNote
|
||||
try { SkillBuilder.Instance?.NotifyNoteHit(TrackIndex, judgeResult, SkillDefinition.NoteTypeTrigger.Tap); } catch { }
|
||||
LogTapJudge(judgeResult, 0f, false, true, pressTime);
|
||||
|
||||
if (isSyncNote)
|
||||
{
|
||||
effectEventController.TryTriggerMultiNoteShake();
|
||||
}
|
||||
|
||||
globalNoteEffect.TryTrigger(noteData != null ? noteData.noteFunction : null);
|
||||
|
||||
Judge();
|
||||
}
|
||||
|
||||
@@ -437,6 +458,13 @@ public class Note : BaseNote
|
||||
|
||||
try { SkillBuilder.Instance?.NotifyNoteHit(TrackIndex, judgeResult, SkillDefinition.NoteTypeTrigger.Tap); } catch { }
|
||||
LogTapJudge(judgeResult, rawOffsetMs, rewrittenToPerfect, false, pressTime);
|
||||
|
||||
if (isSyncNote && judgeResult != "Miss")
|
||||
{
|
||||
effectEventController.TryTriggerMultiNoteShake();
|
||||
}
|
||||
|
||||
globalNoteEffect.TryTrigger(noteData != null ? noteData.noteFunction : null);
|
||||
}
|
||||
|
||||
Judge();
|
||||
|
||||
Reference in New Issue
Block a user