mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:27:39 +02:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user