A very simple modified version of PoolableManager that allows a facade class to forward an initialization parameter to objects in the subcontainer that implement IPoolable<T>.
This enables a clean way for all subcomponents to access the param data sent to the facade OnSpawned:
public void OnSpawned(ParamData data, IMemroyPool pool)
{
_pool = pool;
_customPoolableManager.TriggerOnSpawned(data);
}
//subcomponent.cs
public void OnSpawned(ParamData data)
Rather than having to do something like
public void OnSpawned()
{
_data = _facade.GetData();
}
in every subcomponent, which feels like a limitation of the current PoolableManager.
A very simple modified version of PoolableManager that allows a facade class to forward an initialization parameter to objects in the subcontainer that implement
IPoolable<T>
.This enables a clean way for all subcomponents to access the param data sent to the facade OnSpawned:
Rather than having to do something like
in every subcomponent, which feels like a limitation of the current PoolableManager.