30 lines
896 B
C#
30 lines
896 B
C#
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);
|
|
}
|
|
}
|