Exemplo n.º 1
0
 void piece_clickAction(object sender, PiecesEventArgs e)
 {
     if (_locked)
     {
         return;
     }
     else if (_firstClick == null)
     {
         _firstClick = e.Value;
         _firstClick.AddSelected();
     }
     else if(Board.CheckForSwap(_firstClick, e.Value) && _firstClick != e.Value)
     {
         _locked = true;
         _firstClick.RemoveSelected();
         StartCoroutine(_board.Swap(_firstClick, e.Value));
         _firstClick = null;
     }
     else
     {
         _firstClick.RemoveSelected();
         _firstClick = null;
     }
 }