示例#1
0
    private void setWorkoutMode(WorkoutMode mode)
    {
        workoutMode            = mode;
        newWorkout.workoutMode = workoutMode;

        optionsLayout.transform.localScale = new Vector2(1, 0);

        switch (workoutMode)
        {
        case WorkoutMode.time:
            timeModeButton.gameObject.SetActive(false);
            repsModeButton.gameObject.SetActive(true);
            workOption.gameObject.SetActive(true);
            restOption.gameObject.SetActive(true);
            repsOption.gameObject.SetActive(false);
            break;

        case WorkoutMode.reps:
            timeModeButton.gameObject.SetActive(true);
            repsModeButton.gameObject.SetActive(false);
            workOption.gameObject.SetActive(false);
            restOption.gameObject.SetActive(false);
            repsOption.gameObject.SetActive(true);
            break;
        }

        optionsLayout.transform.DOScaleY(1, 0.25f);
    }
示例#2
0
        public int roundsPerSet;                                //Optional rounds per set when no exercises specified

        public Workout(WorkoutMode mode)
        {
            exercises        = new Dictionary <string, ExerciseDataItem>();
            this.workoutMode = mode;
        }
示例#3
0
    /// <summary>
    /// Function for use in inspector
    /// </summary>
    /// <param name="type"></param>
    public void setWorkoutMode(string type)
    {
        WorkoutMode enumType = (WorkoutMode)Enum.Parse(typeof(WorkoutMode), type.ToLower());

        setWorkoutMode(enumType);
    }