Пример #1
0
 private HouseData SetupHouseValue(HouseData theHouse)
 {
     if (gameMasterRef.currentHouseBids == null)
     {
         theHouse.SetValue(gameMasterRef.GetValueForHome(theHouse.GetFamNum()));
         return(theHouse);
     }
     for (int i = 0; i < gameMasterRef.currentHouseBids.Count; i++)
     {
         if (gameMasterRef.currentHouseBids[i].GetID() == theHouse.GetID())
         {
             return(gameMasterRef.currentHouseBids[i]);
         }
     }
     theHouse.SetValue(gameMasterRef.GetValueForHome(theHouse.GetFamNum()));
     return(theHouse);
 }
Пример #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()));
    }