public void AddLateObserver(IMetronomeObserver observer) { lateObservers.Add(observer); }
public void RemoveObserver(IMetronomeObserver observer) { observers.Remove(observer); lateObservers.Remove(observer); }
/*IEnumerator Beat(float initialDelaySeconds) * { * float intervalPreBeat; * float intervalPostBeat; * yield return new WaitForSeconds(initialDelaySeconds); * while (true) * { * intervalPreBeat = interval * (1f - leadUpTime); * intervalPostBeat = interval * leadUpTime; * PreNotifyObservers(); * yield return new WaitForSeconds(intervalPreBeat); * NotifyObservers(); * if(playTensionClip) { * audioSource.clip = tensionClip; * playTensionClip = false; * } * else * { * audioSource.clip = beatClip[beatNumber]; * } * audioSource.Play(); * beatNumber = (beatNumber + 1) % beatClip.Length; * yield return new WaitForSeconds(intervalPostBeat); * } * }*/ public void AddObserver(IMetronomeObserver observer) { observers.Add(observer); }