Exemplo n.º 1
0
    public void plus(string type)
    {
        optionType enumType = (optionType)Enum.Parse(typeof(optionType), type.ToLower());

        switch (enumType)
        {
        case optionType.work:
            workText.setTimeText(newWorkout.globalWorkTime += workStep);
            doValueAnimation(workText.transform);
            break;

        case optionType.rest:
            restText.setTimeText(newWorkout.globalRestTime += restStep);
            doValueAnimation(restText.transform);
            break;

        case optionType.sets:
            setsText.text = (newWorkout.globalSets += setStep).ToString();
            doValueAnimation(setsText.transform);
            break;

        case optionType.reps:
            repsText.text = (newWorkout.globalReps += repStep).ToString();
            doValueAnimation(repsText.transform);
            break;
        }
    }
Exemplo n.º 2
0
 iniOption BaseOption(string category, string name, optionType type, string label, string description)
 {
     return(new iniOption()
     {
         ini = this,
         category = category,
         name = name,
         type = type,
         label = label,
         description = description,
         inidata = "",
         enabled = true,
         found = false
     });
 }
Exemplo n.º 3
0
    public void min(string type)
    {
        optionType enumType = (optionType)Enum.Parse(typeof(optionType), type.ToLower());

        switch (enumType)
        {
        case optionType.work:
            if ((newWorkout.globalWorkTime - workStep) >= workStep)
            {
                workText.setTimeText(newWorkout.globalWorkTime -= workStep);
                doValueAnimation(workText.transform);
            }
            break;

        case optionType.rest:
            if ((newWorkout.globalRestTime - restStep) >= restStep)
            {
                restText.setTimeText(newWorkout.globalRestTime -= restStep);
                doValueAnimation(restText.transform);
            }
            break;

        case optionType.sets:
            if ((newWorkout.globalSets - setStep) > 0 || (newWorkout.globalSets - setStep) == setStep)
            {
                setsText.text = (newWorkout.globalSets -= setStep).ToString();
                doValueAnimation(setsText.transform);
            }
            break;

        case optionType.reps:
            if ((newWorkout.globalReps - repStep) > 0 || (newWorkout.globalReps - repStep) == repStep)
            {
                repsText.text = (newWorkout.globalReps -= repStep).ToString();
                doValueAnimation(repsText.transform);
            }
            break;
        }
    }