using System.Collections.Generic;
namespace UnityUtils {
public static class EnumeratorExtensions {
///
/// Converts an IEnumerator to an IEnumerable.
///
/// An instance of IEnumerator.
/// An IEnumerable with the same elements as the input instance.
public static IEnumerable ToEnumerable(this IEnumerator e) {
while (e.MoveNext()) {
yield return e.Current;
}
}
}
}