Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67f06a4

Browse files
author
Corne van Rensburg
committed
Changed IEnumerator to Coroutine
1 parent 7fd1e96 commit 67f06a4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Audio/AudioController.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private void Configure() {
8585
private void Dispose() {
8686
// cancel all jobs in progress
8787
foreach(DictionaryEntry _kvp in m_JobTable) {
88-
IEnumerator _job = (IEnumerator)_kvp.Value;
88+
Coroutine _job = (Coroutine)_kvp.Value;
8989
StopCoroutine(_job);
9090
}
9191
}
@@ -94,9 +94,8 @@ private void AddJob(AudioJob _job) {
9494
// cancel any job that might be using this job's audio source
9595
RemoveConflictingJobs(_job.type);
9696

97-
IEnumerator _jobRunner = RunAudioJob(_job);
97+
Coroutine _jobRunner = StartCoroutine(RunAudioJob(_job));
9898
m_JobTable.Add(_job.type, _jobRunner);
99-
StartCoroutine(_jobRunner);
10099
Log("Starting job on ["+_job.type+"] with operation: "+_job.action);
101100
}
102101

@@ -105,7 +104,7 @@ private void RemoveJob(AudioType _type) {
105104
Log("Trying to stop a job ["+_type+"] that is not running.");
106105
return;
107106
}
108-
IEnumerator _runningJob = (IEnumerator)m_JobTable[_type];
107+
Coroutine _runningJob = (Coroutine)m_JobTable[_type];
109108
StopCoroutine(_runningJob);
110109
m_JobTable.Remove(_type);
111110
}

0 commit comments

Comments
 (0)