mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:27:39 +02:00
Second Contact (#363)
* second contact sprites * Started rewriting * Sound stuff * foreigner textbox * default miss message * implement basic player textbox * transparency support for textbox refactor function labels to use C# convention * avoid double function call with mistranslation * add mistranslation textbox * fix logic with trailing translation * auto-positioning of translated text content * auto-hide textboxes on start * icon * Added two new helper functions for pitching with semitones and cents * All new sounds should be in now * bunch of visual fixes * Fixed stuff being innaccurate * Repeating voicelines begone! * Thump sound for bob man * Put an animator on the crowd * Fixed missing sprites * Fixed anim not playing sometimes on barely * Changed length of pass turn event from 0.5 to 1 beat long * Downscaled Sprites yippee * Auto look at * Fixed bob's textbox not appearing sometimes * Fixed some small things --------- Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com> Co-authored-by: Seanski2 <seanbenedit@gmail.com>
This commit is contained in:
@ -159,6 +159,30 @@ namespace HeavenStudio.Util
|
||||
|
||||
source.KillLoop(fadeTime);
|
||||
}
|
||||
|
||||
public static float GetPitchFromSemiTones(int semiTones, bool pitchToMusic)
|
||||
{
|
||||
if (pitchToMusic)
|
||||
{
|
||||
return Mathf.Pow(2f, (1f / 12f) * semiTones) * Conductor.instance.musicSource.pitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Mathf.Pow(2f, (1f / 12f) * semiTones);
|
||||
}
|
||||
}
|
||||
|
||||
public static float GetPitchFromCents(int cents, bool pitchToMusic)
|
||||
{
|
||||
if (pitchToMusic)
|
||||
{
|
||||
return Mathf.Pow(2f, (1f / 12f) * (cents / 100)) * Conductor.instance.musicSource.pitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Mathf.Pow(2f, (1f / 12f) * (cents / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user