public void OnExcerciseSelected(ExerciseUIItem _item) { if (selectedItem != null) { selectedItem.Deselect(); } selectedItem = _item; selectedItem.Select(); selectedInfoDisplay.ShowScreen(_item); }
public void ShowScreen(ExerciseUIItem _item) { StartCoroutine("Show"); ExerciseUIItem selectedItem = ExerciseSelectionManager.instance.GetSelectedItem(); Exercise exercise = selectedItem.excercise; excersiseNameDisplay.text = exercise.excerciseName; totalTimesDisplay.text = exercise.totalTimesDone.ToString(); totalTimesMonthDisplay.text = exercise.totalTimesDoneMonth.ToString(); equipmentDisplay.text = exercise.equipmentGroup.ToString(); setsValueDisplay.Show(); breakValueDisplay.Show(); if (exercise.setIsTimed) { setDurationValueDisplay.Show(); } else { setDurationValueDisplay.Hide(); } }
public void DisplayItems() { for (int i = 0; i < spawnedItems.Count; i++) { Destroy(spawnedItems[i].gameObject); } spawnedItems.Clear(); for (int i = 0; i < excerciseManager.exercises.Count; i++) { Exercise currentExercise = excerciseManager.exercises[i]; GameObject spawnedObject = Instantiate(uiItemPrefab, itemHolder); ExerciseUIItem UIItem = spawnedObject.GetComponent <ExerciseUIItem>(); UIItem.excercise = currentExercise; if (currentExercise.totalTimesDoneToday > 0) { UIItem.SetDoneForToday(); } UIItem.UpdateUI(); spawnedItems.Add(UIItem); } ShowCurrentCategory(); }