Cleaning up
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user