private void Start() { //retrive the previous match score from the score manager. //score manager gameobject is inside shooting race scene, //and it update the scores of the entites. ScoreManager.Score lastMatchScore = ScoreManager.RetriveMatchScore(); int nAiScore = lastMatchScore.AIScore; int nPlayerScore = lastMatchScore.playerScore; SetScores(nPlayerScore, nAiScore); RectTransform victoryRect = m_Victory.GetComponent <RectTransform>(); m_Victory.enabled = true; if (nAiScore > nPlayerScore) { victoryRect.localPosition = SetWinnerImageV3(m_AiImageTransform); return; } if (nAiScore < nPlayerScore) { victoryRect.localPosition = SetWinnerImageV3(m_PlayerImageTransform); //temp hack Constant.PLAYER_MONEY += Constant.BET_MONEY; return; } m_Victory.text = "DRAW!"; }
private void Start() { m_MoneyCount.text = Constant.BET_MONEY.ToString(); //temp HACK ScoreManager.Score lastMatchScore = ScoreManager.RetriveMatchScore(); if (lastMatchScore.AIScore == lastMatchScore.playerScore) { CallEvent(OnMoneyCountAnimationOver); return; } StartCoroutine(SubtractMoneyUpdate()); }
public void DisplayScores(HeroType type) { ScoreManager sm = GameManager.instance.scoreManager; if (sm.highScores.ContainsKey(type)) { ScoreManager.Score score = sm.highScores [type]; enemiesDefeated.text = score.enemiesDefeated.ToString(); wavesSurvived.text = score.wavesSurvived.ToString(); maxCombo.text = score.maxCombo.ToString(); } else { enemiesDefeated.text = "-"; wavesSurvived.text = "-"; maxCombo.text = "-"; } }