I have a object pool that I want to dynamically grow and shrink.
/// <summary>
/// Will remove inactive gameobjects. This method is called every 10-20 seconds.
/// </summary>
/// <param name="name">Type "ListOfObjects.Name." to find the object you want.</param>
public void DecreasePool(ListOfObjects.Name name)
{
foreach (var item in AvailableObjectPool)
{
if (item.ObjectName == name && item.Objectpool.activeInHierarchy != true)
{
Destroy(item.Objectpool);
break;
}
}
AvailableObjectPool.RemoveAll(item => item.Objectpool == null);
}
I have tried searching for answers for these errors but I still don’t understand what “supported pptr” means or why “ObjectDisposed” is thrown since all other methods check for a null object.