Exemplo n.º 1
0
    public void Init(WorkoutPlayerController controller, WorkoutData activeWorkout, int activeExerciseIndex)
    {
        _controller = controller;

        Clear();

        _workoutTimelineSegments = new List <WorkoutTimelineSegment> ();

        foreach (ExerciseData exercise in activeWorkout.exerciseData)
        {
            WorkoutTimelineSegment newWorkoutTimelineSegment = Instantiate(_workoutTimelineSegmentPrefab, _segmentParent);
            float amountComplete = ((float)exercise.totalInitialSets - (float)exercise.totalSets) / (float)exercise.totalInitialSets;
            newWorkoutTimelineSegment.Init(this, amountComplete);
            _workoutTimelineSegments.Add(newWorkoutTimelineSegment);
        }

        _activeSegmentIndicator.color = ColorManager.Instance.ActiveColorLight;

        ShowSegmentActiveDelayed(activeExerciseIndex);
    }
Exemplo n.º 2
0
 public void ShowSegmentActive(int index)
 {
     _activeSegmentIndicator.transform.DOMoveX(_workoutTimelineSegments [index].transform.position.x, SNAP_SPEED);
     _activeWorkoutTimelineSegment = _workoutTimelineSegments [index];
 }