Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions HitScoreVisualizer/HarmonyPatches/FlyingScoreSpawnerPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using SiraUtil.Affinity;
using UnityEngine;

namespace HitScoreVisualizer.HarmonyPatches;

internal class FlyingScoreSpawnerPatch : IAffinity
{
[AffinityPrefix]
[AffinityPriority(1000)]
[AffinityPatch(typeof(FlyingScoreSpawner), nameof(FlyingScoreSpawner.SpawnFlyingScoreNextFrame))]
internal bool SpawnFlyingScoreNextFrame(FlyingScoreSpawner __instance, IReadonlyCutScoreBuffer cutScoreBuffer, Color color)
{
// The scoring element owns a pooled CutScoreBuffer. If spawning is deferred for a frame,
// the element can be despawned and its buffer reused for another note before it is read.
__instance.SpawnFlyingScore(cutScoreBuffer, color);
return false;
}
}
3 changes: 2 additions & 1 deletion HitScoreVisualizer/Installers/HsvPlayerInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public override void InstallBindings()
// Patches
Container.BindInterfacesTo<MissedNoteEffectSpawnerPatch>().AsSingle();
Container.BindInterfacesTo<BadNoteCutEffectSpawnerPatch>().AsSingle();
Container.BindInterfacesTo<FlyingScoreSpawnerPatch>().AsSingle();
Container.BindInterfacesTo<FlyingScoreEffectPatch>().AsSingle();
}
}
}