예제 #1
0
 public void SetCoords(CheckerCoords newCoords)
 {
     _coords = newCoords;
     // Reached end
     if (IsWhite ? newCoords.Y == 8 : newCoords.Y == 1 && !IsQueen)
     {
         BecomeQueen();
     }
     transform.position = _board.CheckerToWorldCoords(newCoords);
 }
예제 #2
0
    void ShowAvailableMoves(List <CheckerMove> moves)
    {
        ClearAvailableMoves();

        Debug.Log("Showing moves");

        foreach (var move in moves)
        {
            var ghost = _objectPooler.GetPooledObject(0);
            ghost.transform.position = _board.CheckerToWorldCoords(move.destinationCoords);
            ghost.SetActive(true);

            _ghosts.Add(ghost, move);
        }
    }
예제 #3
0
    void CheckOutput()
    {
        try {
            var t     = output.text;
            var split = t.Split(new [] { " " }, StringSplitOptions.RemoveEmptyEntries);


            for (int i = 0; i < split.Length; ++i)
            {
                CheckerCoords coords = TextToCoords(split[i]);

                touchMoveProvider.Raycast(_board.CheckerToWorldCoords(coords));
            }
        }
        catch (Exception e) {
            androidDebug.AddLog(e.ToString());
        }
    }