BTSDS: Piano!!!

This commit is contained in:
Jenny Crowe
2022-03-07 02:16:31 -07:00
parent 5711a1508b
commit 2ac602dbe6
5 changed files with 81 additions and 21 deletions

View File

@ -184,5 +184,16 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS
shooterAnim.Play("Shoot", 0, 0);
elevatorAnim.Play("MakeRod", 0, 0);
}
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);
BeatAction.New(gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(beat + length, delegate { Jukebox.KillLoop(pianoSource, 0.1f); })
});
}
}
}