Пример #1
0
    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);
    }
Пример #2
0
    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);
    }
Пример #3
0
    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();
    }