/// <summary> /// Modifies the Unity text objects to show the score values as text on the screen /// </summary> private void GetScoreAndLevel() { foreach (OverallScoreStorage overallScore in overallScoreSeq) { if (overallScore.AbilityName == AbilityName.POINTING) { pointingScore.text = overallScore.Score.ToString(); pointingLevel.text = overallScore.Level.ToString(); pointingRadialScoreRing.Score = overallScore.Score; pointingRadialScoreRing.BeginAnimation(); } if (overallScore.AbilityName == AbilityName.INHIBITION) { inhibitionScore.text = overallScore.Score.ToString(); inhibitionLevel.text = overallScore.Level.ToString(); inhibitionRadialScoreRing.Score = overallScore.Score; inhibitionRadialScoreRing.BeginAnimation(); } if (overallScore.AbilityName == AbilityName.SELECTIVE_VISUAL) { selectiveVisualScore.text = overallScore.Score.ToString(); selectiveVisualLevel.text = overallScore.Level.ToString(); selectiveVisualRadialScoreRing.Score = overallScore.Score; selectiveVisualRadialScoreRing.BeginAnimation(); } if (overallScore.AbilityName == AbilityName.VISUOSPATIAL_SKETCHPAD) { visuospatialSketchpadScore.text = overallScore.Score.ToString(); visuospatialSketchpadLevel.text = overallScore.Level.ToString(); visuospatialSketchpadRadialScoreRing.Score = overallScore.Score; visuospatialSketchpadRadialScoreRing.BeginAnimation(); } if (overallScore.AbilityName == AbilityName.TIME_TO_CONTACT) { timeToContactScore.text = overallScore.Score.ToString(); timeToContactLevel.text = overallScore.Level.ToString(); timeToContactRadialScoreRing.Score = overallScore.Score; timeToContactRadialScoreRing.BeginAnimation(); } if (overallScore.AbilityName == AbilityName.OBJECT_RECOGNITION) { objectRecognitionScore.text = overallScore.Score.ToString(); objectRecognitionLevel.text = overallScore.Level.ToString(); objectRecognitionRadialScoreRing.Score = overallScore.Score; objectRecognitionRadialScoreRing.BeginAnimation(); } } }
/// <summary> /// Update the score and level text on scene. /// </summary> private void UpdateScoreAndLevelText() { OverallScoreStorage scoreAndLevel = new OverallScoreStorage(); // Get the overallScoreStorage based on the curently active ability result scene switch (currentSceneName) { case SceneName.INHIBITION_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.INHIBITION); break; case SceneName.OBJECT_RECOGNITION_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.OBJECT_RECOGNITION); break; case SceneName.POINTING_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.POINTING); break; case SceneName.SELECTIVE_VISUAL_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.SELECTIVE_VISUAL); break; case SceneName.TIME_TO_CONTACT_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.TIME_TO_CONTACT); break; case SceneName.VISUOSPATIAL_SKETCHPAD_RESULT_SCENE: scoreAndLevel = GetOverallScoreStorageForOneAbility(AbilityName.VISUOSPATIAL_SKETCHPAD); break; } // Set Text scoreValue.text = scoreAndLevel.Score.ToString(); levelValue.text = scoreAndLevel.Level.ToString(); RadialScoreRing radialScoreRing = GameObject.Find("RadialScoreRing").GetComponent <RadialScoreRing>(); radialScoreRing.GetComponent <RadialScoreRing>().Score = scoreAndLevel.Score; radialScoreRing.BeginAnimation(); }