/// <summary>
 /// Create a new pool from a PredefinedObjectPool.
 /// </summary>
 /// <param name="predefinedPool">The parameters to set.</param>
 /// <returns>A new GameObject with an ObjectPool component.</returns>
 public static ObjectPool FromPredefined(PredefinedObjectPool predefinedPool)
 {
     var objectPool = new GameObject(predefinedPool.Prefab.name + " Pool").AddComponent<ObjectPool>();
     objectPool.IsPredefined = true;
     objectPool._prefab = predefinedPool.Prefab;
     objectPool._min = predefinedPool.Min;
     objectPool._max = predefinedPool.Max;
     objectPool._usageRatio = predefinedPool.UsageRatio;
     objectPool._active.Clear();
     objectPool._inactive.Clear();
     objectPool.Validate();
     return objectPool;
 }
 /// <summary>
 /// Create a new pool from a PredefinedObjectPool.
 /// </summary>
 /// <param name="prefab">The prefab parameter to set.</param>
 /// <returns>A new GameObject with an ObjectPool component.</returns>
 public static ObjectPool FromPrefab(GameObject prefab)
 {
     var objectPool = new GameObject(prefab.name + " Pool").AddComponent<ObjectPool>();
     objectPool.IsPredefined = false;
     objectPool._prefab = prefab;
     objectPool._min = 0;
     objectPool._max = 0;
     objectPool._usageRatio = 1.0f;
     objectPool._active.Clear();
     objectPool._inactive.Clear();
     objectPool.Validate();
     return objectPool;
 }