public void ManageNextScene()
    {
        Debug.Log("GetCurrentExercise: " + UserDataObject.GetCurrentExercise().fileName);
        Debug.Log("GetLastTierExercise: " + UserDataObject.GetLastTierExercise().fileName);
        Debug.Log("CurrentExercise ID: " + PlayerPrefs.GetInt("CurrentExerciseId"));

        // Check if a side is not accomplished
        foreach (var side in _currentExerciseData.sides)
        {
            Debug.Log("side direction: " + side.direction);
            Debug.Log("side accomplished: " + side.accomplished);
            if (side.accomplished == false)
            {
                _sideNotAccomplished = true;
            }
        }

        // Not last exercise --> load following side
        if (_currentExerciseData != _lastExercise || _sideNotAccomplished)
        {
            Debug.Log("any sideNotAccomplished? : " + _sideNotAccomplished);
            if (_sideNotAccomplished)
            {
                // TODO change subtitle of success GO

                if (PlayerPrefs.GetInt("CurrentSideId") == 0)
                {
                    Debug.Log("LOAD LEFT");
                    PlayerPrefs.SetInt("CurrentSideId", 1);
                    PlayerPrefs.SetString("CurrentSide", "Left");
                    LoadNextScene("ExerciseInfo");
                }
                else if (PlayerPrefs.GetInt("CurrentSideId") == 1)
                {
                    Debug.Log("LOAD RIGHT");
                    PlayerPrefs.SetInt("CurrentSideId", 0);
                    PlayerPrefs.SetString("CurrentSide", "Right");
                    LoadNextScene("ExerciseInfo");
                }
            }
            else             // all sides accomplished --> load next exercise
            {
                // TODO change subtitle of success GO
                UserDataObject.GetNextExercise().isInteractable = true;
                UserDataObject.GetNextExercise().unlocked       = 1;

                PlayerPrefs.SetInt("CurrentExerciseId", PlayerPrefs.GetInt("CurrentExerciseId") + 1);
                LoadNextScene("ExerciseSideSelection");
            }
        }
        else         // all exercises completed --> load TierMenu
        {
            // TODO change subtitle of success GO
            UserDataObject.GetNextTier().isInteractable = true;

            if (!UserDataObject.GetCurrentExercise().isInteractable)
            {
                UserDataObject.GetCurrentExercise().isInteractable = true;
                UserDataObject.GetCurrentExercise().unlocked       = 1;
            }


            LoadNextScene("TierMenu");
        }
        SaveCurrentExerciseData();
    }
    private void ToggleAndCheckRepetition()
    {
        StopTracking();

        _minTimeAlreadyReached = false;
        _bothFeetUp            = false;
        _inStartingPosition    = false;

        textReps.text = "Reps " + _repsIterator + "/" + UserDataObject.GetCurrentRepetitionsArray().Length;

        Debug.Log("ACCOMPLISHED REPETITION");
        Debug.Log("Activate Handcursor");
//		if (!CanvasHandCursor.activeSelf)
//		{
//			CanvasHandCursor.gameObject.SetActive(true);
//			_interactionManager.enabled = true;
//		}

        // Save the time and confidence for the current repetition
        _currentRepetition.userTime   = _durationManager.GetlatestTimeInSeconds();
        _currentRepetition.confidence = _currentRepetitionConfidence / confidenceIterator;
        _currentRepetition.attempts   = attemptsIterator;

        Debug.Log("Repetition time: " + _currentRepetition.userTime + " || confidence: " + _currentRepetition.confidence);

        // Toggle current repetition
        _currentRepetition.accomplished = true;
        _toggleArray[Array.IndexOf(UserDataObject.GetCurrentRepetitionsArray(), _currentRepetition)].isOn = true;

        // Check if last repetition
        if (_currentRepetition == UserDataObject.GetCurrentRepetitionsArray().Last())
        {
            // Exercise and side accomplished
            _currentExerciseData.accomplished = true;
            UserDataObject.GetCurrentSide().accomplished = true;

            // Set values for side attempts, confidence, and time regarding repetitions
            UserDataObject.GetCurrentSide().userTime   = 0.0f;
            UserDataObject.GetCurrentSide().confidence = 0.0f;
            UserDataObject.GetCurrentSide().attempts   = 0;
            foreach (var repetition in UserDataObject.GetCurrentRepetitionsArray())
            {
                UserDataObject.GetCurrentSide().userTime   += repetition.userTime;
                UserDataObject.GetCurrentSide().confidence += repetition.confidence;
                UserDataObject.GetCurrentSide().attempts   += repetition.attempts;
            }
            // Set the avg usertime and confidence for the current side
            UserDataObject.GetCurrentSide().userTime   /= UserDataObject.GetCurrentRepetitionsArray().Length;
            UserDataObject.GetCurrentSide().confidence /= UserDataObject.GetCurrentRepetitionsArray().Length;

            // Set values for exercise attempts, confidence, and time regarding sides
            sideAccomplishedCounter         = 0;
            _currentExerciseData.confidence = 0.0f;
            _currentExerciseData.userTime   = 0.0f;
            _currentExerciseData.attempts   = 0;
            foreach (var side in UserDataObject.GetCurrentExercise().sides)
            {
                if (side.accomplished)
                {
                    sideAccomplishedCounter++;
                    _currentExerciseData.confidence += side.confidence;
                    _currentExerciseData.userTime   += side.userTime;
                    _currentExerciseData.attempts   += side.attempts;
                }
            }
            // Set the avg usertime and confidence for the current exercise
            _currentExerciseData.userTime   /= sideAccomplishedCounter;
            _currentExerciseData.confidence /= sideAccomplishedCounter;


            // If all sides accomplished
            bool     allSidesAccomplished = true;
            SideData nextSide;
            foreach (var side in _currentExerciseData.sides)
            {
                if (side.accomplished == false)
                {
                    allSidesAccomplished = false;
                }
            }

            if (allSidesAccomplished)
            {
                // If last exercise --> accomplish current tier
                Debug.Log("PlayerPrefs.GetInt(CurrentExerciseId)" + PlayerPrefs.GetInt("CurrentExerciseId"));
                Debug.Log("UserDataObject.GetCurrentTierErcisesLength()" + UserDataObject.GetCurrentTierErcisesLength());
                if (PlayerPrefs.GetInt("CurrentExerciseId") == UserDataObject.GetCurrentTierErcisesLength() - 1)
                {
                    // todo All exercises accomplished congratulations or so
                    UserDataObject.GetCurrentTier().accomplished = true;

                    // If last tier reached --> do nothing
                    if (PlayerPrefs.GetInt("CurrentTierId") == UserDataObject.GetAllTiers().Count - 1)
                    {
                    }
                    else                     // If not last tier --> unlock next tier
                    {
                        TierData nextTier = UserDataObject.GetNextTier();
                        nextTier.isInteractable = true;
                    }
                }
                else                 // If not last exercise --> unlock next exercise
                {
                    ExerciseData nextExerciseData = UserDataObject.GetNextExercise();

                    nextExerciseData.isInteractable = true;
                    nextExerciseData.unlocked       = 1;

//				UserDataObject.currentUser.exerciseData[PlayerPrefs.GetInt("CurrentExerciseId") + 1].isInteractable = true;
//				UserDataObject.currentUser.exerciseData[PlayerPrefs.GetInt("CurrentExerciseId") + 1].unlocked = 1;
                }
            }

            //		 Save data to user json file
            SaveCurrentExerciseData();

            // Load the summary scene
            StartCoroutine(loadSummaryScene());
        }         // If not last repetition --> current repetition is next repetition
        else
        {
            _currentRepetition =
                UserDataObject.GetCurrentRepetitionsArray()[Array.IndexOf(UserDataObject.GetCurrentRepetitionsArray(), _currentRepetition) + 1];
            PlayerPrefs.SetInt("CurrentRepetitionId", Array.IndexOf(UserDataObject.GetCurrentRepetitionsArray(), _currentRepetition));
            startTrackingAgain = true;
            Debug.Log("STARTTRAKCINGAGAIN" + startTrackingAgain);
            //		 Save data to user json file
            SaveCurrentExerciseData();
        }

        Debug.Log("-----------------------");
        Debug.Log("TOGGLEANDSAVE");
        Debug.Log("-----------------------");

        // Reset all variables needed for next repetition
        _currentRepetitionConfidence = 0;
        confidenceIterator           = 0;
        attemptsIterator             = 0;

        _durationManager.ResetlatestTimeInSeconds();
        _durationManager.ResetProgress();

        _firstCheckpoint  = false;
        _secondCheckpoint = false;

        pufferList.Clear();

        if (startTrackingAgain)
        {
            StartCoroutine("StartTracking");
//              StartCoroutine("RewindAnimateSuccess");
        }
    }