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
- yield return time;
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
 
packages/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.tunnelsnakes.audiosystem",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "displayName": "TS AudioSystem",
5
5
  "description": "Audio and vibrations",
6
6
  "license": "proprietary",