Timing Window Improvements (#199)

* implement a fix for #196

- improve checking for unwanted inputs in minigame scripts, see Fan Club, Karate Man, and Pajama Party for examples
- provisionally implemented calculating average player input offset

* update samurai slice ds to new assets

implement near miss feedback

* import new pajama party assets
This commit is contained in:
minenice55
2023-01-13 23:53:25 -05:00
committed by GitHub
parent 54c4899f9d
commit eaba812665
68 changed files with 4529 additions and 881 deletions

View File

@ -60,6 +60,21 @@ namespace HeavenStudio
public static GameManager instance { get; private set; }
private EventCaller eventCaller;
List<int> inputOffsetSamples = new List<int>();
float averageInputOffset = 0;
public float AvgInputOffset
{
get
{
return averageInputOffset;
}
set
{
inputOffsetSamples.Add((int)value);
averageInputOffset = (float)inputOffsetSamples.Average();
}
}
private void Awake()
{
// autoplay = true;
@ -344,6 +359,8 @@ namespace HeavenStudio
public void Play(float beat)
{
canInput = true;
inputOffsetSamples.Clear();
averageInputOffset = 0;
StartCoroutine(PlayCo(beat));
onBeatChanged?.Invoke(beat);
}
@ -383,6 +400,8 @@ namespace HeavenStudio
onBeatChanged?.Invoke(beat);
KillAllSounds();
Debug.Log($"Average input offset for playthrough: {averageInputOffset}ms");
if (playOnStart)
{
Play(0);