//Extension public static void Pool <T>(this T _instance, string _poolName = null) where T : class { PoolsOfType <T> .GetPool(_poolName).Push(_instance); }
public static T Pop <T>(string _poolName = null) where T : class { return(PoolsOfType <T> .GetPool(_poolName).Pop()); }
// Extension method as a shorthand for Push function public static void Pool <T>(this T obj, string poolName = null) where T : class { PoolsOfType <T> .GetPool(poolName).Push(obj); }
public static Pool <T> GetPool <T>(string _name = null) where T : class { return(PoolsOfType <T> .GetPool(_name)); }
// NOTE: if you don't need two or more pools of same type, // leave poolName as null while calling any of these functions // for better performance public static SimplePool <T> GetPool <T>(string poolName = null) where T : class { return(PoolsOfType <T> .GetPool(poolName)); }