using System; using System.Collections.Generic; namespace Unity.Multiplayer.Samples.BossRoom.Shared.Infrastructure { public class DisposableGroup : IDisposable { readonly List m_Disposables = new List(); public void Dispose() { foreach (var disposable in m_Disposables) { disposable.Dispose(); } m_Disposables.Clear(); } public void Add(IDisposable disposable) { m_Disposables.Add(disposable); } } }