private static void CheckPointsRequirement() { int currentLevel = SceneManager.GetActiveScene().buildIndex - 1; if (_score >= Requirements.GetPoints(currentLevel)) { _metRequirements = true; HUD.UpdateScoreColor(); } }
void OnTriggerEnter2D(Collider2D other) { int currentLevel = SceneManager.GetActiveScene().buildIndex - 1; if ((other.gameObject.name == "Player") && (PlayerScore.Score >= Requirements.GetPoints(currentLevel))) { PlayerControll.CanPause = false; Time.timeScale = 0; DisplayEndLevelScreen(); SetScoreText(); LoadSaveManager.SaveGame(); } else if ((other.gameObject.name == "Player") && (PlayerScore.Score < Requirements.GetPoints(currentLevel))) { gameObject.GetComponentInChildren <AudioSource>().Play(); } }