예제 #1
0
    void FillSummaryList()
    {
        Debug.Log(_currentTierData.fileName);
        Debug.Log(_currentTierData.tips);
        Debug.Log(_currentTierData.tips[1]);

        foreach (var exercise in _currentTierData.exercises)
        {
            textTimeExName.text = textAttemptsExName.text = textConfidenceExName.text = exercise.exerciseName;

            GameObject gameObjectTierExerciseTime       = Instantiate(exerciseTimeImage) as GameObject;
            GameObject gameObjectTierExerciseConfidence = Instantiate(exerciseConfidenceImage) as GameObject;
            GameObject gameObjectTierExerciseAttempts   = Instantiate(exerciseAttemptsImage) as GameObject;

            TierSummaryExerciseTimeImage summaryTimeImage =
                gameObjectTierExerciseTime.GetComponent <TierSummaryExerciseTimeImage>();
            TierSummaryExerciseConfidenceImage summaryConfidenceImage =
                gameObjectTierExerciseConfidence.GetComponent <TierSummaryExerciseConfidenceImage>();
            TierSummaryExerciseAttemptImage summaryAttemptImage =
                gameObjectTierExerciseAttempts.GetComponent <TierSummaryExerciseAttemptImage>();


            summaryTimeImage.avgTimeText.text = exercise.userTime.ToString("F1");
            summaryTimeImage.GetComponent <Image>().fillAmount = exercise.userTime / UserDataObject.GetCurrentTierAllExercisesHighestTime();

            summaryConfidenceImage.avgConfidence.text = exercise.confidence.ToString("F0");
            summaryConfidenceImage.GetComponent <Image>().fillAmount = exercise.confidence / 100;

            summaryAttemptImage.avgAttempt.text = exercise.attempts.ToString();
            summaryAttemptImage.GetComponent <Image>().fillAmount = exercise.attempts / UserDataObject.GetCurrentTierAllExercisesHighestAttempt();

            gameObjectTierExerciseTime.transform.SetParent(timeSpacer, false);
            gameObjectTierExerciseConfidence.transform.SetParent(confidenceSpacer, false);
            gameObjectTierExerciseAttempts.transform.SetParent(attemptsSpacer, false);
        }
    }