Exemplo n.º 1
0
    public void IncreaseBid()
    {
        AuctionHandler auction     = State.getAuctionHandler();
        App            app         = UnityEngine.Object.FindObjectOfType <App>();
        int            playerIndex = app.GetHumanIndex();
        Nation         player      = State.getNations()[playerIndex];

        auction.incrementPlayerBid(playerIndex);

        TextMeshProUGUI playerBid = playerBidText.GetComponent <TextMeshProUGUI>();

        playerBid.text = auction.getPlayerBid(playerIndex).ToString();
        if (auction.getAuctionType() == MyEnum.auctionType.sphere)
        {
            if (auction.getPlayerBid(playerIndex) >= player.getDiplomacyPoints())
            {
                increceBid.gameObject.SetActive(false);
                decreaseBid.gameObject.SetActive(true);
            }
        }
        else
        {
            if (auction.getPlayerBid(playerIndex) >= player.GetColonialPoints())
            {
                increceBid.gameObject.SetActive(false);
                decreaseBid.gameObject.SetActive(true);
            }
        }
        if (auction.getPlayerBid(playerIndex) > auction.getCurrentBid())
        {
            bid.interactable = true;
        }
        else
        {
            bid.interactable = false;
        }
    }