Open MonSterZaaaaack opened 1 year ago
I tried to kill the Tween inside the EnemyRecycle() but It does not work
I think the problem might be when the onComplete calls the EnemyRecycle, it releases(Set active to false)the EnemyObject so it does not return any promises to the Tween, which makes the Tween automatically calls the OnComplete again when the same object is getting activated. But I'm not sure.
Hello, so I'm using an Object pool to manage my Enemy Objects, and whenever an Enemy is died, I'll call the DoScale function on its transform with an OnComplete callback to recycle the object. gameObject.transform.DOScale(new Vector3(0.12f, 0.12f, 0.12f), 0.5f).SetEase(Ease.OutQuad).OnComplete(() => { EnemyRecycle() }); But the problem is after the Enemy Object has been activated by the Object pool again, the OnComplete part will be called immediately, so the Enemy would be Recycled right after it has been reactivated. My question is are there anyways to Reset the OnComplete condition so it would not be called immediately after the object has been reactivated?