예제 #1
0
    IEnumerator drawGhost()
    {
        Ghost ghost = playerManager.drawGhost();

        io.displayCurrentActionInfo(ghost.GhostName + "\nColor: " + ghost.color + "\nResistance: " + ghost.Resistance);
        while (true)
        {
            GSCoroutine <GameObject> clickedGSC = io.getClickedGameObject("_PlayerBoardSpace");
            yield return(clickedGSC.coroutine);

            while (clickedGSC.result == null)
            {
                yield return(null);
            }
            PlayerBoardSpace pbs = clickedGSC.result.GetComponent <PlayerBoardSpace>();
            if (!pbs.hasGhost())
            {
                pbs.addGhost(ghost);
                break;
            }
            else
            {
                yield return(StartCoroutine(io.displayNotificationMessage("You must choose an empty space!")));
            }
            yield return(null);
        }
        io.clearCurrentActionInfo();
    }