void OnGUI()
    {
        GUI.skin = _skin;
        GUI.Label(new Rect(10, 10, 400, 230), _mode.ModeName);
        switch (_mode.ModeName)
        {
        case "CardSelection":
            if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "Done"))
            {
                Debug.Log("Done button clicked in selection mode.");
                ChangeMode(new ActionMode(player));
            }
            break;

        case "Action":
            if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "Buy cards"))
            {
                Debug.Log("Switching to buy mode.");
                ChangeMode(new BuyMode(player));
            }
            break;

        case "Buy":
            if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "End turn"))
            {
                Debug.Log("Beginning new Action mode for next player");
                ChangeMode(new ActionMode(player.leftNeighbour));
                player = player.leftNeighbour;
                game.cam.ChangeViewTo(player);
            }
            break;

        case "Watch":
            break;

        default:
            Debug.LogError("Invalid mode: " + _mode.ModeName);
            break;
        }

        if (modalDialogue != null)
        {
            GUI.Box(new Rect(Screen.width / 2 - 150, Screen.height / 2 - 75, 300, 150), modalDialogue.Question);
            if (GUI.Button(new Rect(Screen.width / 2 - 145, Screen.height / 2 + 35, 140, 30), "Yes"))
            {
                modalDialogue.YesCallback(null);
                modalDialogue = null;
            }

            if (GUI.Button(new Rect(Screen.width / 2 + 5, Screen.height / 2 + 35, 140, 30), "No"))
            {
                modalDialogue.NoCallback(null);
                modalDialogue = null;
            }
        }
        //General info
        string stats = "Actions: " + player.Actions + "    Money: " + player.Money + "   Buys: " + player.Buys;

        GUI.Box(new Rect(5, Screen.height - 40, Screen.width - 115, 35), stats);
    }
Ejemplo n.º 2
0
    void OnGUI()
    {
        GUI.skin = _skin;
        GUI.Label (new Rect(10, 10, 400, 230), _mode.ModeName);
        switch (_mode.ModeName)
        {
            case "CardSelection":
                if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "Done"))
                {
                    Debug.Log("Done button clicked in selection mode.");
                    ChangeMode(new ActionMode(player));
                }
                break;
            case "Action":
                if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "Buy cards"))
                {
                    Debug.Log ("Switching to buy mode.");
                    ChangeMode(new BuyMode(player));
                }
                break;
            case "Buy":
                if (GUI.Button(new Rect(Screen.width - 105, Screen.height - 40, 100, 35), "End turn"))
                {
                    Debug.Log("Beginning new Action mode for next player");
                    ChangeMode(new ActionMode(player.leftNeighbour));
                    player = player.leftNeighbour;
                    game.cam.ChangeViewTo(player);
                }
                break;
            case "Watch":
                break;
            default:
                Debug.LogError("Invalid mode: " + _mode.ModeName);
                break;
        }

           if (modalDialogue!=null)
           {
           GUI.Box(new Rect(Screen.width/2 -150, Screen.height/2 -75, 300, 150), modalDialogue.Question);
           if(GUI.Button(new Rect(Screen.width/2 -145, Screen.height/2 +35, 140, 30), "Yes"))
           {
               modalDialogue.YesCallback(null);
               modalDialogue = null;
           }

           if (GUI.Button(new Rect(Screen.width/2 + 5, Screen.height/2 + 35, 140, 30), "No"))
           {
               modalDialogue.NoCallback(null);
               modalDialogue = null;
           }

           }
        //General info
        string stats = "Actions: " + player.Actions + "    Money: " + player.Money + "   Buys: " + player.Buys;
        GUI.Box(new Rect(5, Screen.height - 40, Screen.width -115, 35), stats);
    }