Cleaning up

This commit is contained in:
2025-12-26 18:14:48 +01:00
parent 16b0a348e4
commit f53a41f70c
13 changed files with 66 additions and 52 deletions

View File

@@ -188,17 +188,17 @@ public class SoundManager : UdonSharpBehaviour
return;
}
if (!audioSource.isPlaying || audioSource.clip == null)
{
PlaySound(audioSource, audioClip, loop);
}
if (audioSource.clip == audioClip)
{
// No need to switch
return;
}
if (!audioSource.isPlaying || audioSource.clip == null)
{
PlaySound(audioSource, audioClip, loop);
}
var newTimeSamples = (int)(audioSource.timeSamples / (double)audioSource.clip.samples * audioClip.samples);
audioSource.clip = audioClip;