public List <CellView> GenerateCellViews(GridModel gridModel, Action <CellView, CellView> OnSelectedTwoCell) { cellsUI = FindObjectsOfType <CellView>().ToList(); if (cellsUI != null) { foreach (var cell in cellsUI) { Destroy(cell.gameObject); } } if (ClickController) { //Debug.Log("ClickController"); } ClickController.OnSelectedTwoCell = OnSelectedTwoCell; cellsUI = new List <CellView>(); for (int index = 0; index < gridModel.Size; index++) { CellView cellView = CreateCellView(gridModel.GetCellByIndex(index)); cellsUI.Add(cellView); } return(cellsUI); }