Example #1
0
    public void TravelPlayer(TileController tile)
    {
        if (!canTravel)
        {
            return;
        }

        canTravel = false;
        int value = 0;

        moveController.position = currentTile.index;

        LogMessagePlayer($"{this.transform.name} Está de férias e viajou para {tile.tile.nameTile}", false);

        if (moveController.position > tile.index)
        {
            value = (boardController.tileControllers.Count - moveController.position) + (tile.index - 1);
        }
        else
        {
            value = tile.index - moveController.position;
        }

        if (!botController)
        {
            boardController.ResetBoard();
        }

        StartCoroutine(manager.OnMovePlayer(moveController, moveController.MovePlayer(value), false));
    }