// Complete the current course view (or entire course) and transition to the next one // This method calls methods on other systems to handle Learn Points, Notification & already // completed course views. public void CompleteCourseView() { if (IsLastCourseView()) // If this is the last CV: Mark course as completed { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load <CourseCompletionData>(_ccData.fileName); if (!_ccData.isCompleted) { _ccData.Complete(); Serializer.Save <CourseCompletionData>(_ccData, _ccData.fileName); achievementManager.CourseCompleted(curCourse); } else { // Do nothing } } else //else save course and load next view { if (!CourseViewIsCompleted()) { SaveCourseCompletionData(1); achievementManager.CourseViewCompleted(); } else { SaveCourseCompletionData(1); applicationManager.TransitionToCourseViewScene(); } } }
// Complete the current course view (or entire course) and transition to the next one // This method calls methods on other systems to handle Learn Points, Notification & already // completed course views. public void CompleteCourseView() { if (IsLastCourseView()) // If this is the last CV: Mark course as completed { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load<CourseCompletionData>(_ccData.fileName); if (!_ccData.isCompleted) { _ccData.Complete(); Serializer.Save<CourseCompletionData>(_ccData, _ccData.fileName); achievementManager.CourseCompleted(curCourse); } else { // Do nothing } } else //else save course and load next view { if (!CourseViewIsCompleted()) { SaveCourseCompletionData(1); achievementManager.CourseViewCompleted(); } else { SaveCourseCompletionData(1); applicationManager.TransitionToCourseViewScene(); } } }
private CourseCompletionData GetCourseCompletionData() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load <CourseCompletionData>(_ccData.fileName); return(_ccData); }
private int GetCourseCompletionData_Current() { CourseCompletionData _ccData = GetCourseCompletionData(); if (_ccData == null) { Debug.LogError("CourseCompletionData is null. Returning -1"); return(-1); } return(_ccData.currentCVIndex); }
public void SaveCourseCompletionDataIfEmpty() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); if (!Serializer.PathExists(_ccData.fileName)) { Debug.Log("CourseCompletion: No CourseCompletionData found. Saving first CourseView."); SetCurCourseView(0); Serializer.Save <CourseCompletionData>(_ccData, _ccData.fileName); } }
private bool IsLastCourseView() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load <CourseCompletionData>(_ccData.fileName); if (_ccData.currentCVIndex == curCourse.courseViews.Count - 1) { return(true); } else { return(false); } }
public void SaveCourseCompletionData(int _offset) { int _cvIndex = GetCourseViewIndex(curCourseView); if (_cvIndex == -1) { Debug.LogError("CourseView couldn't be found in courseViews list."); return; } CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load <CourseCompletionData>(_ccData.fileName); _ccData.Init(_cvIndex + _offset); Serializer.Save <CourseCompletionData>(_ccData, _ccData.fileName); }
private bool IsLastCourseView() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load<CourseCompletionData>(_ccData.fileName); if (_ccData.currentCVIndex == curCourse.courseViews.Count - 1) return true; else return false; }
private CourseCompletionData GetCourseCompletionData() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load<CourseCompletionData>(_ccData.fileName); return _ccData; }
public void SaveCourseCompletionDataIfEmpty() { CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); if (!Serializer.PathExists(_ccData.fileName)) { Debug.Log("CourseCompletion: No CourseCompletionData found. Saving first CourseView."); SetCurCourseView(0); Serializer.Save<CourseCompletionData>(_ccData, _ccData.fileName); } }
public void SaveCourseCompletionData(int _offset) { int _cvIndex = GetCourseViewIndex(curCourseView); if (_cvIndex == -1) { Debug.LogError("CourseView couldn't be found in courseViews list."); return; } CourseCompletionData _ccData = new CourseCompletionData(curCourse.ID); _ccData = Serializer.Load<CourseCompletionData>(_ccData.fileName); _ccData.Init(_cvIndex + _offset); Serializer.Save<CourseCompletionData>(_ccData, _ccData.fileName); }