public void verificaVitoria(int countSpawner) { if (countSpawner == qntSpawner) { run.Stop(); Time.timeScale = 0; PlayerPrefs.SetInt("" + NomeDaFase, 1); HeartControl heartControl = Heart.GetComponent <HeartControl> (); heartControl.velocityBeat = 0; timeUI.gameObject.SetActive(false); textPoints.gameObject.SetActive(false); UILevelsManager uiManager = UIManager.GetComponent <UILevelsManager> (); uiManager.OpenLevelCompleteUI(); TimerManager timeManager = UIManager.GetComponent <TimerManager> (); totalTimeUILComplete.text = "Tempo: " + timeManager.timeString; string timePlayer = timeManager.timeString; pointsUILComplete.text = "Pontos: " + points; int bonus = calculateBonusTime(); bonusTimeUILComplete.text = "Bônus por tempo: x" + bonus; int totalPoints = points * bonus; totalPointsUILComplete.text = "Total: " + totalPoints; saveTimeAndPoints(totalPoints, timePlayer); } }
public void verificaHealth(float calcHealth) { if (calcHealth == 0) { run.Stop(); Time.timeScale = 0; HeartControl heartControl = Heart.GetComponent <HeartControl> (); heartControl.velocityBeat = 0; timeUI.gameObject.SetActive(false); textPoints.gameObject.SetActive(false); UILevelsManager uiManager = UIManager.GetComponent <UILevelsManager> (); uiManager.OpenGameOverUI(); totalPointsUIGOver.text = "Pontos: " + points; TimerManager timeManager = UIManager.GetComponent <TimerManager> (); totalTimeUIGOver.text = "Tempo: " + timeManager.timeString; } }