|
Post by SALARD on Mar 1, 2019 5:38:56 GMT
anyone else update and have issues with this code after the unity update? 2018.3.6f1 error:Cannot set the parent of the GameObject 'Card View(Clone)' while it is being destroyed.
basepooler: protected virtual void OnDestroy () { EnqueueAll(); if (autoClear) UnRegister(); }
gameobjectpoolcontroller
public static void Enqueue (Poolable sender) { if (sender == null || sender.isPooled || !pools.ContainsKey(sender.key)) return; PoolData data = pools[sender.key]; if (data.pool.Count >= data.maxCount) { GameObject.Destroy(sender.gameObject); return; } data.pool.Enqueue(sender); sender.isPooled = true; sender.transform.SetParent(Instance.transform); sender.gameObject.SetActive(false); }
|
|
|
Post by SALARD on Mar 17, 2019 19:14:12 GMT
got it! commented out enqueueall function - resolved - the objects all get destroyed on change scene anyway so dont see this causing an issue.
protected virtual void OnDestroy () { // COMMENTING OUT TO RESOLVE CHANGE SCENE settransform while being destroyed error DESTROY--- EnqueueAll(); if (autoClear) UnRegister(); }
|
|
|
Post by Admin on Mar 18, 2019 15:12:46 GMT
Glad you found something that works for you, thanks for sharing too
|
|