Space Soccer Improvements (#382)

* SupahScrollSetUp

* Scrolls now, with issues, also added a flames animation

* Started implementing new multiple space kickers

* bg recolor space soccer

* Recolorable dots!

* we circular motitating n shit

* ReAdded Enter and exit stuff

* I despise unexplainable bugs

* The balls are so buggy 😱

* Trying to fix someting

* Fixed Scroll Stutter

* Fixed a whiff bug

* Updated sounds and added ease event for space kickers

* Fixed some bugs

* Changed some names

* new option for quiz show random presses

* Board meeting bug fixes

* Testing Curve stuff

* Converted all code to use new curves, need to fix all issues

* Playing around with keypoint values, will probably expose them so someone else can mess with them

* curves be like

* Fixed stuff

* BALLS FIXED

* Fixed clappy trio stuff

* Added player move event

* Almost fixed, just need to fix wonkiness with high kick toe

* Fixed da bug

* Board meeting and quiz show tweaks

* Fix for board meeting and enter/exit presets for space soccer

* Stop ball added

* Updated how scroll works
This commit is contained in:
Rapandrasmus
2023-04-26 14:43:35 +02:00
committed by GitHub
parent 7858bdba3d
commit ac1804a901
63 changed files with 2930 additions and 6163 deletions

View File

@ -113,7 +113,7 @@ namespace HeavenStudio.Util
/// Unpitched, non-scheduled, non-looping sounds are played using a global One-Shot audio source that doesn't create a Sound object.
/// Looped sounds return their created Sound object so they can be canceled after creation.
/// </summary>
public static Sound PlayOneShot(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false, string game = null)
public static Sound PlayOneShot(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false, string game = null, float offset = 0f)
{
AudioClip clip = null;
if (game != null)
@ -153,6 +153,7 @@ namespace HeavenStudio.Util
snd.pitch = pitch;
snd.volume = volume;
snd.looping = looping;
snd.offset = offset;
// snd.pitch = (clip.length / Conductor.instance.secPerBeat);
GameManager.instance.SoundObjects.Add(oneShot);
@ -224,13 +225,13 @@ namespace HeavenStudio.Util
/// Unpitched, non-scheduled, non-looping sounds are played using a global One-Shot audio source that doesn't create a Sound object.
/// Looped sounds return their created Sound object so they can be canceled after creation.
/// </summary>
public static Sound PlayOneShotGame(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false, bool forcePlay = false)
public static Sound PlayOneShotGame(string name, float beat = -1, float pitch = 1f, float volume = 1f, bool looping = false, bool forcePlay = false, float offset = 0f)
{
string gameName = name.Split('/')[0];
var inf = GameManager.instance.GetGameInfo(gameName);
if (GameManager.instance.currentGame == gameName || forcePlay)
{
return PlayOneShot($"games/{name}", beat, pitch, volume, looping, inf.usesAssetBundle ? gameName : null);
return PlayOneShot($"games/{name}", beat, pitch, volume, looping, inf.usesAssetBundle ? gameName : null, offset);
}
return null;

View File

@ -48,9 +48,9 @@ namespace HeavenStudio.Util
{
Util.Sound s;
if (game)
s = Jukebox.PlayOneShotGame(sounds[i].name, sounds[i].beat - Conductor.instance.GetRestFromRealTime(sounds[i].offset), sounds[i].pitch, sounds[i].volume, sounds[i].looping, forcePlay);
s = Jukebox.PlayOneShotGame(sounds[i].name, sounds[i].beat, sounds[i].pitch, sounds[i].volume, sounds[i].looping, forcePlay, sounds[i].offset);
else
s = Jukebox.PlayOneShot(sounds[i].name, sounds[i].beat - Conductor.instance.GetRestFromRealTime(sounds[i].offset), sounds[i].pitch, sounds[i].volume, sounds[i].looping);
s = Jukebox.PlayOneShot(sounds[i].name, sounds[i].beat, sounds[i].pitch, sounds[i].volume, sounds[i].looping, null, sounds[i].offset);
ms.playingSounds.Add(s);
}

View File

@ -26,6 +26,7 @@ namespace HeavenStudio.Util
private double startTime;
public float beat;
public float offset;
public float scheduledPitch = 1f;
bool playInstant = false;
@ -52,7 +53,7 @@ namespace HeavenStudio.Util
{
playInstant = false;
scheduledPitch = cnd.SongPitch;
startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch);
startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch) - offset;
audioSource.PlayScheduled(startTime);
}
}