com.tunnelsnakes.audiosystem 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,10 +102,15 @@ public class AudioPresenter : MonoBehaviour {
|
|
|
102
102
|
|
|
103
103
|
private IEnumerator WaitForEnd() {
|
|
104
104
|
var time = new WaitForFixedUpdate();
|
|
105
|
-
while (_audioSource.isPlaying || ((_audioSource.timeSamples != 0) && (_audioSource.timeSamples != _audioSource.clip.samples))) { //Ended or stopped, not paused
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
//while (_audioSource.isPlaying || ((_audioSource.timeSamples != 0) && (_audioSource.timeSamples != _audioSource.clip.samples))) { //Ended or stopped, not paused
|
|
106
|
+
// yield return time;
|
|
107
|
+
//}
|
|
108
|
+
bool isPlayingInPrevFrame, isPlaying = false;
|
|
109
|
+
do {
|
|
110
|
+
isPlayingInPrevFrame = isPlaying;
|
|
111
|
+
isPlaying = _audioSource.isPlaying || ((_audioSource.timeSamples != 0) && (_audioSource.timeSamples != _audioSource.clip.samples));
|
|
112
|
+
yield return time;
|
|
113
|
+
} while (isPlaying || isPlayingInPrevFrame);
|
|
109
114
|
Stop();
|
|
110
115
|
}
|
|
111
116
|
|