//ends the level
    public void CompleteLevel()
    {
        NotificationManager.instance.HideHelp();
        objectiveEdgeView.Hide();

        int levelToUnlock    = GameManager.instance.curLevelId;
        int curFurthestLevel = GameProgress.farthestLevel;

        do
        {
            levelToUnlock++;
            if (levelToUnlock > curFurthestLevel && LevelManager.instance.levelData [levelToUnlock].type == LevelManager.LevelData.Type.Endless)
            {
                NotificationManager.instance.ShowBanner("New endless unlocked");
            }
        } while (levelToUnlock < (LevelManager.instance.levelData.Count - 1) && LevelManager.instance.levelData [levelToUnlock].type != LevelManager.LevelData.Type.Campaign);
        GameProgress.farthestLevel = levelToUnlock;

        if (GameManager.instance.levelData.type == LevelManager.LevelData.Type.Cutscene)
        {
            Continue();
            return;
        }

        if (!string.IsNullOrEmpty(winMessage))
        {
            winText.text = winMessage;
        }
        winScreen.SetActive(true);
        isComplete = true;
        winSound.Play();
        GameProgress.CompleteLevel(GameManager.instance.curLevelId);

        GameManager.instance.EndLevel();
    }