public void SelectingThisCell(CellBase cell) { if (CurrentStatus != GameStatus.NowPlaying || isThinking) { return; } if (CurrentGameMode == GameMode.TwoPlayer || isWhite == ChessSide.White) { if (cell.CurrentType != null && cell.CellStatus == CellBase.CellType.None && cell.CurrentType.IsWhite == isWhite) { if (preCell != null) { foreach (var item in TempCell) { item.ClearView(); } } TempCell.Clear(); Selecting.color = new Color(1, 1, 1, 1); Selecting.transform.position = cell.gameObject.transform.position; isSelecting = true; var temp = FindAllPossibleMove(cell); ShowTempMove(cell, temp); preCell = cell; } else if (cell.CurrentType != null && cell.CellStatus == CellBase.CellType.Temp && cell.CurrentType.IsWhite == isWhite) { ChessBase chess = cell.CurrentType; foreach (var item in TempCell) { item.ClearView(); } TempCell.Clear(); if (preCell != null && preCell.CurrentType != null) { LastMove = new clsMove(new Vector2(preCell.PosX + 1, preCell.PosY + 1), new Vector2(cell.PosX + 1, cell.PosY + 1)); int index2 = preCell.CurrentType.IsWhite == ChessSide.White ? 1 : 2; _BoardState [(int)preCell.CurrentType.Position.x + 1, (int)preCell.CurrentType.Position.y + 1] = 0; preCell.ClearPreCell(); preCell.ClearView(); preCell = null; } cell.SetView(chess); Selecting.color = new Color(1, 1, 1, 0); arrMove = clsChessEngine.FindAllLegalMove(_BoardState, MyMove.CurPos, cell.CurrentType.Type); if (_BoardState [(int)cell.CurrentType.Position.x + 1, (int)cell.CurrentType.Position.y + 1] / 10 == 6) { EndGame(); } else { int index = cell.CurrentType.IsWhite == ChessSide.White ? 1 : 2; _BoardState [(int)cell.CurrentType.Position.x + 1, (int)cell.CurrentType.Position.y + 1] = (int)cell.CurrentType.Type * 10 + index; isWhite = isWhite == ChessSide.Black ? ChessSide.White : ChessSide.Black; } arrFEN.Add(clsFEN.GetPiecePlacementString(this._BoardState)); } } else { ComputerMove(); } }