public static async UniTaskVoid Instantiate(Transform parent, RoomXpReport roomXpReport, PersonalFullUserInfo personalFullUserInfo, UserRoomStatus userRoomStatus) { var obj = await Addressables.InstantiateAsync("myRoomResultView", parent); obj.GetComponent <RoomResultPanel>() .Construct(roomXpReport, personalFullUserInfo, userRoomStatus); }
public void InitGame(PersonalFullUserInfo myFullUserInfo, ActiveRoomState activeRoomState, int messageIndex) { Debug.Log("InitGame is being called"); Repository.I.PersonalFullInfo = myFullUserInfo; Repository.I.PersonalFullInfo.DecreaseMoneyAimTimeLeft().Forget(); this.messageIndex = messageIndex; LoadAppropriateModules(activeRoomState); }
private void Construct(RoomXpReport roomXpReport, PersonalFullUserInfo personalFullUserInfo, UserRoomStatus userRoomStatus) { if (roomXpReport.Competition == 0) { competetionScoreText.transform.parent.gameObject.SetActive(false); } if (roomXpReport.Basra == 0) { basraScoreText.transform.parent.gameObject.SetActive(false); } if (roomXpReport.BigBasra == 0) { bigBasraScoreText.transform.parent.gameObject.SetActive(false); } if (roomXpReport.GreatEat == 0) { greatEatScoreText.transform.parent.gameObject.SetActive(false); } competetionScoreText.text = $"+{roomXpReport.Competition}xp"; basraScoreText.text = $"+{roomXpReport.Basra}xp"; bigBasraScoreText.text = $"+{roomXpReport.BigBasra}xp"; greatEatScoreText.text = $"+{roomXpReport.GreatEat}xp"; eatenCards.text = userRoomStatus.EatenCards.ToString(); basras.text = userRoomStatus.Basras.ToString(); superBasras.text = userRoomStatus.BigBasras.ToString(); earnedMoney.text = userRoomStatus.WinMoney.ToString(); winStreak.text = personalFullUserInfo.WinStreak.ToString(); if (userRoomStatus.WinMoney == 0) { competitionStateText.text = "خسرت"; competitionStateText.color = Color.red; } else if (userRoomStatus.WinMoney < RoomSettings.I.Bet) //because the ticket is taken { competitionStateText.text = "تعادل"; competitionStateText.color = Color.grey; } else { competitionStateText.text = "كسبت"; competitionStateText.color = Color.green; } //eatenCards.text = (personalFullUserInfo.EatenCardsCount - oldInfo.EatenCardsCount).ToString(); //basras.text = (personalFullUserInfo.BasraCount - oldInfo.BasraCount).ToString(); //superBasras.text = (personalFullUserInfo.BigBasraCount - oldInfo.BigBasraCount).ToString(); //winRatioChange.text = (personalFullUserInfo.WinRatio - oldInfo.WinRatio).ToString("p2"); //know win or loose by this //var moneyChange = (personalFullUserInfo.Money - oldInfo.Money); //var bet = RoomSettings.Bets[betChoice]; //if (moneyChange < 0) earnedMoney.color = Color.red; //else earnedMoney.text = ((bet - (bet * .1f)) * 2).ToString("f0"); }