Misc Additions #4 (#192)

* update icons

* add background loading of sound sequences

- fix bug with preFunction
- remove most of the old preloading code

* update spritesheets for karate man, marching orders

* file explorer chart loading

* update icon for trick on the class
This commit is contained in:
minenice55
2023-01-11 20:42:12 -05:00
committed by GitHub
parent ddc183acdd
commit 41e9d36177
89 changed files with 1970 additions and 459 deletions

View File

@ -38,27 +38,28 @@ namespace HeavenStudio.Util
audioSource.pitch = pitch;
audioSource.volume = volume;
audioSource.loop = looping;
Conductor cnd = Conductor.instance;
if (beat == -1 && !scheduled)
{
audioSource.PlayScheduled(AudioSettings.dspTime);
playInstant = true;
played = true;
startTime = Conductor.instance.songPositionAsDouble;
startTime = cnd.songPositionAsDouble;
StartCoroutine(NotRelyOnBeatSound());
}
else
{
playInstant = false;
scheduledPitch = Conductor.instance.musicSource.pitch;
startTime = (AudioSettings.dspTime + (Conductor.instance.GetSongPosFromBeat(beat) - Conductor.instance.songPositionAsDouble)/(double)scheduledPitch);
scheduledPitch = cnd.musicSource.pitch;
startTime = cnd.dspStartTimeAsDouble + ((cnd.GetSongPosFromBeat(beat - cnd.startBeatAsDouble))/(double)scheduledPitch);
audioSource.PlayScheduled(startTime);
Debug.Log($"Scheduling future sound {clip.name} for beat {beat} (scheduled: {startTime}, current time: {AudioSettings.dspTime})");
}
}
private void Update()
{
Conductor cnd = Conductor.instance;
if (!played)
{
if (scheduled)
@ -78,12 +79,11 @@ namespace HeavenStudio.Util
}
else
{
if (!played && scheduledPitch != Conductor.instance.musicSource.pitch)
if (!played && scheduledPitch != cnd.musicSource.pitch)
{
scheduledPitch = Conductor.instance.musicSource.pitch;
startTime = (AudioSettings.dspTime + (Conductor.instance.GetSongPosFromBeat(beat) - Conductor.instance.songPositionAsDouble)/(double)scheduledPitch);
scheduledPitch = cnd.musicSource.pitch;
startTime = (AudioSettings.dspTime + (cnd.GetSongPosFromBeat(beat) - cnd.songPositionAsDouble)/(double)scheduledPitch);
audioSource.SetScheduledStartTime(startTime);
Debug.Log($"Rescheduling future sound {clip.name} for beat {beat} (scheduled: {startTime}, current time: {AudioSettings.dspTime})");
}
}
}
@ -93,7 +93,7 @@ namespace HeavenStudio.Util
{
if (looping && loopEndBeat != -1) // Looping sounds play forever unless params are set.
{
if (Conductor.instance.songPositionInBeats > loopEndBeat)
if (cnd.songPositionInBeats > loopEndBeat)
{
KillLoop(fadeTime);
loopIndex++;