/// <summary> /// Performs pooled instantiation on a specific prefab, and returns requested T MonoBehaviour from it /// This one passes to AutoPooler instead (which automatically checks if object is .IsAvaiable) /// </summary> /// <param name="prefab">GameObject prefab</param> /// <returns>Instantiated object</returns> public static T AutoPool <T>(this GameObject prefab) where T : MonoBehaviour, IGenericPoolElement { return(AutoPooler.InstantiateFromPool <T>(prefab)); }