More debug information when not connected

parent 38dc192f
...@@ -12,11 +12,19 @@ public class VAUSignalSourceAudioFile : VAUSignalSource ...@@ -12,11 +12,19 @@ public class VAUSignalSourceAudioFile : VAUSignalSource
[Tooltip("Will immediately start the signal source payback.")] [Tooltip("Will immediately start the signal source payback.")]
public bool PlayOnStart = true; public bool PlayOnStart = true;
void Awake()
{
if (!VAUAdapter.VA.IsConnected())
{
Debug.LogError( 'Could not create signal source "' + FilePath + '", not connected to VA' );
return;
}
}
void OnEnable() void OnEnable()
{ {
_ID = VAUAdapter.VA.CreateSignalSourceBufferFromFile (FilePath, Name); _ID = VAUAdapter.VA.CreateSignalSourceBufferFromFile (FilePath, Name);
Debug.Assert (_ID.Length > 0, "Could not create audio file signal source '" + Name + "' from file path " + FilePath); Debug.Assert (_ID.Length > 0, "Could not create audio file signal source '" + Name + "' from file path " + FilePath);
VAUAdapter.VA.SetSignalSourceBufferLooping (_ID, IsLooping); VAUAdapter.VA.SetSignalSourceBufferLooping (_ID, IsLooping);
} }
......
...@@ -36,8 +36,11 @@ public class VAUSoundSource : MonoBehaviour ...@@ -36,8 +36,11 @@ public class VAUSoundSource : MonoBehaviour
{ {
_VA = VAUAdapter.VA; _VA = VAUAdapter.VA;
if (!_VA.IsConnected()) if (!_VA.IsConnected())
return; {
Debug.LogError( 'Could not create sound source, not connected to VA' );
return;
}
// Add sound source // Add sound source
_ID = _VA.CreateSoundSource(this.name); _ID = _VA.CreateSoundSource(this.name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment