示例#1
0
    private static void CheckPointsRequirement()
    {
        int currentLevel = SceneManager.GetActiveScene().buildIndex - 1;

        if (_score >= Requirements.GetPoints(currentLevel))
        {
            _metRequirements = true;
            HUD.UpdateScoreColor();
        }
    }
示例#2
0
    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();
        }
    }