public void ShowStats() { PhotonNetwork.LeaveRoom(); if (Avatar != null) { Avatar.SetProfile(ProfileManager.Instance().PlayerProfile); } thisMatchStat.PlayTime = _finishTime - _startTime; win = rank == 1; thisMatchStat.Wins = win ? 1 : 0; WinText.SetActive(win); RankText.gameObject.SetActive(!win); RankText.text = "# " + rank; MatchXP xp = BrExpManager.CalculateXP(thisMatchStat); KillCount.text = thisMatchStat.Kills.ToString(); KillPoint.text = (xp.K + xp.Dk + xp.Tk).ToString(); WinPoint.text = xp.W.ToString(); _matchTotalXp = xp.K + xp.Dk + xp.Tk + xp.W + xp.AP; MatchText.text = _matchTotalXp.ToString(); thisMatchStat.Experience = _matchTotalXp; rewardShow.gameObject.SetActive(true); levelSlider.addedXp = _matchTotalXp; GetComponent <PlayableDirector>().Play(); SaveMatchRecordToProfile(); Invoke("ShowReward", 1f); }
public static MatchXP CalculateXP(MatchStats match) { Statistics stat = playerStat; MatchXP matchXp = new MatchXP { K = (match.Kills - 2 * match.DoubleKills - 3 * match.TripleKills) * Multiplyer, Dk = match.DoubleKills * 2 * Multiplyer, Tk = match.TripleKills * 4 * Multiplyer, AP = match.SupplyDrop * 2 * Multiplyer, W = match.Wins * 5 * Multiplyer, P = (1 + (int)(match.PlayTime / 60)) * Multiplyer }; return(matchXp); }