You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
547 B
C#
26 lines
547 B
C#
3 weeks ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Unity.BossRoom.Infrastructure
|
||
|
{
|
||
|
public class DisposableGroup : IDisposable
|
||
|
{
|
||
|
readonly List<IDisposable> m_Disposables = new List<IDisposable>();
|
||
|
|
||
|
public void Dispose()
|
||
|
{
|
||
|
foreach (var disposable in m_Disposables)
|
||
|
{
|
||
|
disposable.Dispose();
|
||
|
}
|
||
|
|
||
|
m_Disposables.Clear();
|
||
|
}
|
||
|
|
||
|
public void Add(IDisposable disposable)
|
||
|
{
|
||
|
m_Disposables.Add(disposable);
|
||
|
}
|
||
|
}
|
||
|
}
|