CSharp examples for System.Collections.Generic:IEnumerable
Helper method which turns a single item into an enumerable.
using System.Linq; using System;/* w ww .j av a2 s .c o m*/ using System.Collections.Generic; using System.Collections; using UnityEngine; public class Main{ /// <summary> /// Helper method which turns a single item into an enumerable. /// </summary> public static IEnumerable<T> ToEnumerable<T>(this T item) { if (item == null) yield break; yield return item; } }