mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:47:38 +02:00
Fixed AudioSource.time bug, check Conductor.cs for comment.
This commit is contained in:
@ -4,6 +4,8 @@ using UnityEngine;
|
||||
|
||||
using Starpelly;
|
||||
|
||||
// I CANNOT STRESS THIS ENOUGH, SET "Project Settings/Audio/DSP Buffer Size" to "Best latency" or else AudioSource.time WILL NOT update every frame.
|
||||
|
||||
namespace RhythmHeavenMania
|
||||
{
|
||||
[RequireComponent(typeof(AudioSource))]
|
||||
@ -71,7 +73,7 @@ namespace RhythmHeavenMania
|
||||
// musicSource.Play();
|
||||
}
|
||||
|
||||
void Update()
|
||||
public void Update()
|
||||
{
|
||||
// Conductor.instance.musicSource.pitch = Time.timeScale;
|
||||
|
||||
@ -99,9 +101,8 @@ namespace RhythmHeavenMania
|
||||
|
||||
public float GetLoopPositionFromBeat(float startBeat, float length)
|
||||
{
|
||||
float final = Starpelly.Mathp.Normalize(songPositionInBeats, startBeat, startBeat + length);
|
||||
|
||||
return final;
|
||||
float a = Mathp.Normalize(songPositionInBeats, startBeat, startBeat + length);
|
||||
return a;
|
||||
}
|
||||
|
||||
public void SetBpm(float bpm)
|
||||
|
@ -4,7 +4,7 @@ MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 50
|
||||
executionOrder: -20
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
@ -4,7 +4,7 @@ MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 150
|
||||
executionOrder: -8
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
@ -4,7 +4,7 @@ MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 100
|
||||
executionOrder: -10
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
|
@ -112,7 +112,13 @@ namespace RhythmHeavenMania.Games.ClappyTrio
|
||||
{
|
||||
SetFace(i, 4);
|
||||
Lion[i].GetComponent<Animator>().Play("Clap", 0, 0);
|
||||
Jukebox.PlayOneShotGame("clappyTrio/leftClap");
|
||||
|
||||
// lazy fix rn
|
||||
if (i > 0)
|
||||
Jukebox.PlayOneShotGame("clappyTrio/middleClap");
|
||||
else
|
||||
Jukebox.PlayOneShotGame("clappyTrio/leftClap");
|
||||
|
||||
clapIndex++;
|
||||
}
|
||||
break;
|
||||
|
@ -32,12 +32,17 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
float beatLength = 1f;
|
||||
if (high) beatLength = 2f;
|
||||
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(startBeat, beatLength + 0.2f);
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(startBeat, beatLength + 0.15f);
|
||||
print(normalizedBeatAnim + " " + Time.frameCount);
|
||||
|
||||
if (high)
|
||||
if (high)
|
||||
{
|
||||
anim.Play("BallHigh", 0, normalizedBeatAnim);
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
anim.Play("BallLow", 0, normalizedBeatAnim);
|
||||
}
|
||||
|
||||
anim.speed = 0;
|
||||
|
||||
|
@ -37,6 +37,7 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
anim = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
int bruh;
|
||||
private void Update()
|
||||
{
|
||||
if (EligibleHits.Count == 0)
|
||||
@ -46,6 +47,12 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
{
|
||||
Swing();
|
||||
}
|
||||
|
||||
if (Conductor.instance.songPositionInBeats >= 5f && bruh == 0)
|
||||
{
|
||||
Swing();
|
||||
bruh++;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCostume(int costume)
|
||||
|
@ -6,9 +6,8 @@ namespace RhythmHeavenMania.Tests
|
||||
{
|
||||
public class WTF : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
private void FixedUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user