/// <summary> /// Unsubscribe the specified listener to the Maestro. /// </summary> /// <param name="listener">Listener (should be a subclass of MusicBehaviour).</param> public void Unsubscribe(MusicBehaviour listener) { if (listeners.Contains(listener)) { listeners.Remove(listener); onBeat -= listener.OnBeat; lateOnBeat -= listener.LateOnBeat; } }
/// <summary> /// Subscribe the specified listener to the Maestro. /// </summary> /// <param name="listener">Listener (should be a subclass of MusicBehaviour).</param> public void Subscribe(MusicBehaviour listener) { if (!listeners.Contains(listener)) { listeners.Add(listener); onBeat += listener.OnBeat; lateOnBeat += listener.LateOnBeat; } }