/// <summary> /// Gets the behaviours that are indexed by the specified type. /// </summary> /// <returns>The behaviours indexed by the requested type.</returns> /// <typeparam name="T">The indexed type to lookup.</typeparam> public List <T> GetAll <T>() where T : class { var list = ListPool <T> .Take(); IList <object> indexedBehaviours; if (index.TryGet(typeof(T), out indexedBehaviours)) { for (int i = 0; i < indexedBehaviours.Count; i++) { list.Add((T)indexedBehaviours[i]); } } return(list); }