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); }
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()); } }