Skip to content

Commit 436fecc

Browse files
committed
Added property on Playback for querying the Audio Clip being played.
1 parent 8052303 commit 436fecc

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Runtime/Playback.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,21 @@ internal Playback(AudioSource source)
3232

3333
#region Properties
3434

35+
/// <summary>
36+
/// Audio clip being played.
37+
/// </summary>
38+
public AudioClip Clip
39+
{
40+
get => _source == null ? null : _source.clip;
41+
}
42+
3543
/// <summary>
3644
/// Whether the audio playback is active.
3745
/// </summary>
38-
public bool IsPlaying => _source != null && (_source.isPlaying && !_isPaused);
46+
public bool IsPlaying
47+
{
48+
get => _source != null && (_source.isPlaying && !_isPaused);
49+
}
3950

4051
/// <summary>
4152
/// Whether the audio playback is paused.
@@ -49,7 +60,10 @@ public bool IsPaused
4960
/// <summary>
5061
/// Whether the audio playback is finished and can no longer be used.
5162
/// </summary>
52-
public bool IsFinished => _source == null || (!_source.isPlaying && !_isPaused);
63+
public bool IsFinished
64+
{
65+
get => _source == null || (!_source.isPlaying && !_isPaused);
66+
}
5367

5468
/// <summary>
5569
/// Group that the audio playback should output to.

0 commit comments

Comments
 (0)