private void Update() { if (!Tween.IsPaused) { _timeElapsed += Time.deltaTime; if (_timeElapsed > _duration) { PrefabPool.Return(this); } } }
private void ClearGridItemInstances() { for (int i = 0; i < _gridItemInstances.Count; i++) { if (_gridItemInstances[i] != null) { // Destroy(_gridItemInstances[i].gameObject); PrefabPool.Return(_gridItemInstances[i]); } } _gridItemInstances.Clear(); }
private void DestroyGridItemView(GridItemView gridItem) { gridItem.Invalidate(); _gridItemInstances.Remove(gridItem); PrefabPool.Return(gridItem); }