public void CreatePanel(Exercise exercise) { ExerciseEditPanel newPanel = Instantiate(panelPrefab); newPanel.transform.localScale = Vector3.one; currentYPos = currentYPos - 400; newPanel.transform.localPosition = new Vector3(0, currentYPos, 0); newPanel.sets.text = exercise.totalSets.ToString(); newPanel.reps.text = exercise.repCount.ToString(); newPanel.time.text = exercise.timeToComplete.ToString(); scrollItems.Add(newPanel); }
public ExerciseEditPanel CreatePanel(Exercise exercise, PieSlice pieSlice) { ExerciseEditPanel newPanel = Instantiate(panelPrefab); newPanel.exercise = exercise; newPanel.hweel = hweel; newPanel.transform.SetParent(grid.transform); newPanel.pieSlice = pieSlice; panels.Add(newPanel); return(newPanel); }
void HandleAdd() { Exercise newExercise = new Exercise(); newExercise.setsRemaining = 3; newExercise.totalSets = 3; newExercise.repCount = 10; newExercise.timeToComplete = 90; hweel.workout.exercises.Add(newExercise); //hweel.dynamicWheel.exercises.Add(newExercise); // newExercise.timeLeftInSet = newExercise.timeToComplete; // newExercise.totalTime = newExercise.totalSets * newExercise.timeToComplete; ExerciseEditPanel newPanel = CreatePanel(newExercise, null); newPanel.transform.SetAsLastSibling(); addPanelButton.transform.SetAsLastSibling(); hweel.dynamicWheel.EstablishNotches(); }