public static void PlayCallAudioTrack(CallTrack call) { if (call == CallTrack.None) { return; } _instance.PlayAudioTrack(call); }
public static void UnlockCallAudioTrack(CallTrack call) { if (call == CallTrack.None) { return; } if (OnCallUnlocked != null) { OnCallUnlocked(call); } }
public void PlayAudioTrack(CallTrack track) { if (_audioClips.ContainsKey(track)) { _playingClip = track; _callSource.clip = _audioClips[track]; _callSource.Play(); if (OnCallStarted != null) { OnCallStarted(track); } } }
private void Update() { if (_playingClip != CallTrack.None) { if (!_callSource.isPlaying) { if (OnCallEnded != null) { OnCallEnded(_playingClip); } _playingClip = CallTrack.None; } } }