Пример #1
0
    public void BidButton()
    {
        if (assetHouseType)
        {
            //Go to second sell screen
            gameMasterRef.UpdateMenuSelection(MenuOptions.Sell);
            gameMasterRef.MoveSellInitialScreen(house.GetFamNum());
            gameMasterRef.currentSale = house;
            return;
        }
        gameMasterRef.Photon_RecieveIdMatch_AllPlayersFinished(PhotonNetwork.LocalPlayer.ActorNumber);
        //If you have enought money
        if (gameMasterRef.playerPhoton.money >= houseValue + gameMasterRef.bidValue && gameMasterRef.haveBidOnHouse == false)
        {
            if (gameMasterRef.playerPhoton.GetBids() > 0 || bidIconButton.GetComponent <SVGImage>().sprite == noBidIcon)
            {
                if (house.GetLastPersonToBid() != PhotonNetwork.LocalPlayer.ActorNumber && house.GetLastPersonToBid() != 0)
                {
                    gameMasterRef.Photon_SendIdNumber_FinishedCheck(house.GetLastPersonToBid());
                }

                if (bidIconButton.GetComponent <SVGImage>().sprite != noBidIcon)
                {
                    gameMasterRef.playerPhoton.RemoveOneBid();
                }
                bidIconButton.GetComponent <SVGImage>().sprite = yourBidIcon;
                bidIconButton.GetComponent <SVGImage>().color  = yourColor;
                house.SetLastPersonToBid(PhotonNetwork.LocalPlayer.ActorNumber);
                house.SetValue(house.GetValue() + gameMasterRef.bidValue);

                gameMasterRef.EstablishHouseListing_Send(house);

                //gameMasterRef.CreateHouseListing(house); DEPRICATED
                gameMasterRef.haveBidOnHouse = true;
                goodHighlight.SetActive(true);
                goodHighlight.GetComponent <SVGImage>().color = yourColor;
            }
            else
            {
                badHighlight.SetActive(true);
                StartCoroutine(ResetHighlight());
            }
        }
        else
        {
            badHighlight.SetActive(true);
            StartCoroutine(ResetHighlight());
        }
    }
Пример #2
0
    public void UpdateUI(HouseData houseToUpdate, bool isAsset = false)
    {
        //Debug.Log("UI CALLED");
        house = houseToUpdate;

        houseID    = house.GetID();
        houseName  = house.GetTitle();
        houseValue = house.GetValue();
        bidOwner   = house.GetLastPersonToBid();
        value.text = "$" + houseValue.ToString();
        title.text = houseName;

        titleAsset.text = houseName;
        valueAsset.text = "$" + houseValue.ToString();
        if (isAsset)
        {
            //TODO fix this
            UpdateHouseValueText();

            assetHouseType = true;
            assetSellButton.GetComponent <SVGImage>().sprite = assetHouseIcon;
            SwitchState(4);
            return;
        }
        if (house.GetLastPersonToBid() == 0)
        {
            bidIconButton.GetComponent <SVGImage>().sprite = noBidIcon;
            return;
        }
        if (house.GetLastPersonToBid() == PhotonNetwork.LocalPlayer.ActorNumber)
        {
            bidIconButton.GetComponent <SVGImage>().sprite = yourBidIcon;
            bidIconButton.GetComponent <SVGImage>().color  = yourColor;
            return;
        }
        if (bidIconButton.GetComponent <SVGImage>().sprite == yourBidIcon)
        {
            gameMasterRef.haveBidOnHouse = false;
        }
        goodHighlight.SetActive(false);
        bidIconButton.GetComponent <SVGImage>().sprite = bidIcon;
        bidIconButton.GetComponent <SVGImage>().color  = gameMasterRef.GetColorOfPlayer(gameMasterRef.GetOthersListPosition(house.GetLastPersonToBid()));
    }