void ClearLine(int height) { for (var width = 0; width < grids.GetLength(0); width++) { var b = grids[width, height]; if (b != null) { grids[width, height] = null; blockInstanceManager.EndUseBlock(b); } } }
public void RemoveAllBlocks() { if (blocks != null) { for (var i = 0; i < blocks.Length; i++) { if (instanceManager) { instanceManager.EndUseBlock(blocks[i]); } else { Debug.LogWarning("trying to remove all blocks, but instanceManager = null"); GameObject.Destroy(blocks[i]); } } blocks = null; } }