using UnityEngine;
using System.Collections.Generic;
using System.Linq;

public static class UnityEngineObjectExtensions
{
	static public T GetByName<T>(this T[] array, string name) where T : Object
	{
		return array.FirstOrDefault(i => i.name == name);
	}

	static public T GetByName<T>(this List<T> array, string name) where T : Object
	{
		return array.FirstOrDefault(i => i.name == name);
	}

}
