Resolve WES-95 "User progress"
This commit is contained in:
29
Assets/Common/Interfaces/CourseList.cs
Normal file
29
Assets/Common/Interfaces/CourseList.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Keep track of all courses
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "Create new Scriptable/CourseList")]
|
||||
public class CourseList : ScriptableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Index of the active/to be loaded/current course
|
||||
/// </summary>
|
||||
public int currentCourseIndex = 0;
|
||||
|
||||
/// <summary>
|
||||
/// List of all installed courses
|
||||
/// </summary>
|
||||
public List<Course> courses = new List<Course>();
|
||||
|
||||
/// <summary>
|
||||
/// Get a course by CourseIndex
|
||||
/// </summary>
|
||||
/// <param name="courseIndex">CourseIndex of the course, each unique course has a unique CourseIndex</param>
|
||||
/// <returns>Course associated with this index, null if no course was found</returns>
|
||||
public Course GetCourseByIndex(CourseIndex courseIndex)
|
||||
{
|
||||
return courses.Find((c) => c.index == courseIndex);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user