I have a issue on return an object to the pool, it seems to be non blocking but it log an error.
Code: Select all
ReturnToPool: Object not managed by this object pool!
UnityEngine.Debug:LogError(Object)
FlipWebApps.ProPooling.Scripts.Pool`1:ReturnToPool(GameObject) (at Assets/FlipWebApps/ProPooling/Scripts/Pool.cs:238)
MapGenerator:returnToPool(GameObject) (at Assets/Script/Game/MapGenerator.cs:291)
DynamicLetters:destroyMe() (at Assets/Script/Game/DynamicLetters.cs:259)
DynamicLetterPrefab
- DynamicLetterText (a text mesh)
- DynamicLetterObject ( a mesh)
Pro pooling instantiate works correctly in all cases (create, getfrompool ...) and i'm can see also that returntopool works correctly on returntopool because my gameobject come back to the root of hierarchy after his use.
I have use pro pooling since the beginning of my project with a prefab without hierarchy and it was working so good.
My code is working correctly with a prefab without hierarchy.
In MapGenerator.cs
Code: Select all
public void returnToPool(GameObject _poolItem){
_pool.ReturnToPool (_poolItem);
}
Code: Select all
this.transform.rotation = Quaternion.Euler(new Vector3(0,0,0));
this.transform.position = new Vector3(0,0,0);
GameObject.Find ("MatrixPanelLetters").GetComponent<MapGenerator> ().returnToPool (this.gameObject);
Thanks
