Exemplo n.º 1
0
    //menu airport
    void airportMenu(airport currentPlace, playerToken currentPlayer)
    {
        //buy
        if (currentPlace.Owned == false && currentPlayer.money >= currentPlace.price)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .2f, Screen.width * .2f, Screen.height * .1f), "BUY"))
            {
                currentPlace.Buy(currentPlayer);
                VariableManager.turn = 2;
            }
        }

        //sell
        if (currentPlayer.places.Count > 0)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .4f, Screen.width * .2f, Screen.height * .1f), "SELL"))
            {
                this.yourArray       = new List <bool>(currentPlayer.places.Count);
                this.offSet          = 0;
                VariableManager.turn = 5;
            }
        }
        //surrender
        if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .5f, Screen.width * .2f, Screen.height * .1f), "SURRENDER"))
        {
            currentPlayer.surrender();
        }
        //end turn
        if (VariableManager.turn == 2)
        {
            if (GUI.Button(new Rect(Screen.width * .03f, Screen.height * .6f, Screen.width * .2f, Screen.height * .1f), "END TURN"))
            {
                VariableManager.state++;
                if (VariableManager.state == VariableManager.jumlahPlayer)
                {
                    VariableManager.state = 0;
                }
                VariableManager.turn = 0;
            }
        }
    }