Пример #1
0
    IEnumerator MovePhase()
    {
        GS.displayInfoMessage(displayName() + " has entered the move phase.");
        gameBoard.getPossibleMoves(this);
        while (true)
        {
            io.startHoverInfo();
            GSCoroutine <GameObject> clickedGSC = io.getClickedGameObject("_VillageTile");
            yield return(clickedGSC.coroutine);

            while (clickedGSC.result == null)
            {
                yield return(null);
            }
            GridSpace   targetgs = clickedGSC.result.GetComponent <GridSpace>();
            VillageTile vt       = targetgs.VillageTile;
            string      target   = vt.tilename;


            if (gameBoard.movePlayer(this, target))
            {
                GS.displayInfoMessage(displayName() + " is moving to " + target);
                break;
            }
            else
            {
                GS.displayWarnMessage(displayName() + " cannot go there");
            }

            yield return(null);
        }
        GS.displayInfoMessage(displayName() + " has finished the move phase.");
    }