refactor: Remove pitch parameter from PlayAfterDelay coroutine

This commit is contained in:
2026-04-03 14:30:45 +08:00
parent a4f2eb645a
commit e9054d677d
@@ -197,7 +197,7 @@ namespace OCES.Audio
this.m_activeSounds.Add(active); this.m_activeSounds.Add(active);
IncrementClipCount(audioObject.Id); IncrementClipCount(audioObject.Id);
active.Coroutine = StartCoroutine(PlayAfterDelay(active, audioObject, pitch)); active.Coroutine = StartCoroutine(PlayAfterDelay(active, audioObject));
return; return;
} }
@@ -264,13 +264,12 @@ namespace OCES.Audio
source.Play(); source.Play();
} }
IEnumerator PlayAfterDelay(ActiveSound active, AudioObject audioObject, float pitch) IEnumerator PlayAfterDelay(ActiveSound active, AudioObject audioObject)
{ {
Debug.Log($"Delaying for {audioObject.InitialDelay} second(s)."); Debug.Log($"Delaying for {audioObject.InitialDelay} second(s).");
yield return new WaitForSeconds(audioObject.InitialDelay); yield return new WaitForSeconds(audioObject.InitialDelay);
if (!this.m_activeSounds.Contains(active)) yield break; if (!this.m_activeSounds.Contains(active)) yield break;
active.Pitch = pitch;
ExecutePlay(active, isRegistered: true); ExecutePlay(active, isRegistered: true);
} }