mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-25 19:15:16 +00:00
BTSDS: Piano does not pierce ears as much
This commit is contained in:
parent
c6f0da37a2
commit
dd3bdaf87c
3 changed files with 11 additions and 7 deletions
|
@ -188,7 +188,7 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS
|
|||
public void PlayPiano(float beat, float length, int semiTones)
|
||||
{
|
||||
var pianoPitch = Mathf.Pow(2f, (1f / 12f) * semiTones);
|
||||
var pianoSource = Jukebox.PlayOneShotGame("builtToScaleDS/Piano", -1, pianoPitch, true);
|
||||
var pianoSource = Jukebox.PlayOneShotGame("builtToScaleDS/Piano", -1, pianoPitch, 0.8f, true);
|
||||
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace RhythmHeavenMania.Util
|
|||
FindJukebox().GetComponent<AudioSource>().volume = volume;
|
||||
}
|
||||
|
||||
public static AudioSource PlayOneShot(string name, float beat = -1, float pitch = 1f, bool looping = false)
|
||||
public static AudioSource PlayOneShot(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false)
|
||||
{
|
||||
GameObject oneShot = new GameObject("oneShot");
|
||||
|
||||
|
@ -53,6 +53,7 @@ namespace RhythmHeavenMania.Util
|
|||
snd.clip = clip;
|
||||
snd.beat = beat;
|
||||
snd.pitch = pitch;
|
||||
snd.volume = volume;
|
||||
snd.looping = looping;
|
||||
// snd.pitch = (clip.length / Conductor.instance.secPerBeat);
|
||||
|
||||
|
@ -61,7 +62,7 @@ namespace RhythmHeavenMania.Util
|
|||
return audioSource;
|
||||
}
|
||||
|
||||
public static AudioSource PlayOneShotScheduled(string name, double targetTime, float pitch = 1f, bool looping = false)
|
||||
public static AudioSource PlayOneShotScheduled(string name, double targetTime, float pitch = 1f, float volume = 1f, bool looping = false)
|
||||
{
|
||||
GameObject oneShot = new GameObject("oneShotScheduled");
|
||||
|
||||
|
@ -74,6 +75,7 @@ namespace RhythmHeavenMania.Util
|
|||
audioSource.clip = clip;
|
||||
snd.clip = clip;
|
||||
snd.pitch = pitch;
|
||||
snd.volume = volume;
|
||||
snd.looping = looping;
|
||||
|
||||
snd.scheduled = true;
|
||||
|
@ -85,21 +87,21 @@ namespace RhythmHeavenMania.Util
|
|||
return audioSource;
|
||||
}
|
||||
|
||||
public static AudioSource PlayOneShotGame(string name, float beat = -1, float pitch = 1f, bool looping = false)
|
||||
public static AudioSource PlayOneShotGame(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false)
|
||||
{
|
||||
if (GameManager.instance.currentGame == name.Split('/')[0])
|
||||
{
|
||||
return PlayOneShot($"games/{name}", beat, pitch, looping);
|
||||
return PlayOneShot($"games/{name}", beat, pitch, volume, looping);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AudioSource PlayOneShotScheduledGame(string name, double targetTime, float pitch = 1f, bool looping = false)
|
||||
public static AudioSource PlayOneShotScheduledGame(string name, double targetTime, float pitch = 1f, float volume = 1f, bool looping = false)
|
||||
{
|
||||
if (GameManager.instance.currentGame == name.Split('/')[0])
|
||||
{
|
||||
return PlayOneShotScheduled($"games/{name}", targetTime, pitch, looping);
|
||||
return PlayOneShotScheduled($"games/{name}", targetTime, pitch, volume, looping);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace RhythmHeavenMania.Util
|
|||
{
|
||||
public AudioClip clip;
|
||||
public float pitch = 1;
|
||||
public float volume = 1;
|
||||
|
||||
// For use with PlayOneShotScheduled
|
||||
public bool scheduled;
|
||||
|
@ -31,6 +32,7 @@ namespace RhythmHeavenMania.Util
|
|||
audioSource = GetComponent<AudioSource>();
|
||||
audioSource.clip = clip;
|
||||
audioSource.pitch = pitch;
|
||||
audioSource.volume = volume;
|
||||
audioSource.loop = looping;
|
||||
|
||||
if (beat == -1 && !scheduled)
|
||||
|
|
Loading…
Reference in a new issue