private void ReturnToPool() { //grid.SetCellFull(transform.position); grid.SetCellFull(transform.position, GetColor()); if (coinImage.activeSelf == true) { grid.SetCellCoin(transform.position); } gameObject.Recycle(); }
public void Die() { foreach (var tile in tiles) { bool inBounds = grid.SetCellFull(tile.transform.position, tetroType); if (inBounds == false) { pool?.ReturnTetro(this); Debug.Log("Tile (" + tile.name + ") is out of bounds. Triggering Event..."); EventManager.TriggerEvent(EventNames.TetroOutOfBounds); return; } } OnDie?.Invoke(); pool?.ReturnTetro(this); //SetRotation(0); //Falling = false; Active = false; EventManager.TriggerEvent(EventNames.TetroEndFalling); }