diff --git a/AudioController/Assets/OSSC/Example/UIControlsForOSSCExample.cs b/AudioController/Assets/OSSC/Example/UIControlsForOSSCExample.cs
index e675c79..324e29b 100644
--- a/AudioController/Assets/OSSC/Example/UIControlsForOSSCExample.cs
+++ b/AudioController/Assets/OSSC/Example/UIControlsForOSSCExample.cs
@@ -7,13 +7,13 @@ public class UIControlsForOSSCExample : MonoBehaviour
{
public SoundController soundController;
- SoundCueProxy coins;
- SoundCueProxy whosh;
- SoundCueProxy crackingIce;
- SoundCueProxy sfxCue;
- SoundCueProxy sfxCueLoop;
- SoundCueProxy music;
- SoundCueProxy musicWithTag;
+ ISoundCue coins;
+ ISoundCue whosh;
+ ISoundCue crackingIce;
+ ISoundCue sfxCue;
+ ISoundCue sfxCueLoop;
+ ISoundCue music;
+ ISoundCue musicWithTag;
public void PlayCoins()
{
diff --git a/AudioController/Assets/OSSC/Source/SoundController.cs b/AudioController/Assets/OSSC/Source/SoundController.cs
index 72ba079..c9e75b7 100644
--- a/AudioController/Assets/OSSC/Source/SoundController.cs
+++ b/AudioController/Assets/OSSC/Source/SoundController.cs
@@ -52,8 +52,8 @@ public void SetMute(string categoryName, bool value)
/// Creates a SoundCue and plays it.
///
/// A struct which contains all data for SoundController to work
- /// A soundCue proxy which can be subscribed to it's events.
- public SoundCueProxy Play(PlaySoundSettings settings)
+ /// A soundCue interface which can be subscribed to it's events.
+ public ISoundCue Play(PlaySoundSettings settings)
{
if (settings.soundCueProxy != null)
{
@@ -188,7 +188,7 @@ public SoundCueProxy Play(PlaySoundSettings settings)
#region Private methods
private SoundCueProxy PlaySoundCue(PlaySoundSettings settings)
{
- SoundCueProxy cue = settings.soundCueProxy;
+ SoundCueProxy cue = settings.soundCueProxy as SoundCueProxy;
Transform parent = settings.parent;
float fadeInTime = settings.fadeInTime;
float fadeOutTime = settings.fadeOutTime;
@@ -290,7 +290,7 @@ public struct PlaySoundSettings
public float fadeOutTime;
public string categoryName;
public bool isLooped;
- public SoundCueProxy soundCueProxy;
+ public ISoundCue soundCueProxy;
public string tagName;
public void Init()
diff --git a/AudioController/Assets/OSSC/Source/SoundCue.cs b/AudioController/Assets/OSSC/Source/SoundCue.cs
index 34b4442..948fb9e 100644
--- a/AudioController/Assets/OSSC/Source/SoundCue.cs
+++ b/AudioController/Assets/OSSC/Source/SoundCue.cs
@@ -66,6 +66,7 @@ public SoundCue(int id)
public void Play(SoundCueData data)
{
_data = data;
+ AudioObject.isDespawnOnFinishedPlaying = !data.isLooped;
AudioObject.OnFinishedPlaying = OnFinishedPlaying_handler;
// audioObject.isDespawnOnFinishedPlaying = false;
if (TryPlayNext() == false)