Resolve WES-95 "User progress"

This commit is contained in:
Dries Van Schuylenbergh
2023-03-18 10:25:49 +00:00
parent 5e26970bad
commit 9dfadece44
39 changed files with 4208 additions and 69 deletions

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
/// <summary>
/// Class for holding all (static) data about a certain course
/// </summary>
[CreateAssetMenu(menuName = "Create new Scriptable/Course")]
public class Course : ScriptableObject
{
/// <summary>
/// Small class to hold information about a single learnable (e.g., a word or a letter)
/// </summary>
[Serializable]
public class Learnable
{
/// <summary>
/// Name of the word/letter to learn
/// </summary>
public string name;
/// <summary>
/// Sprite of this word/letter
/// </summary>
public Sprite image;
/// <summary>
/// Example video clip
/// </summary>
public VideoClip clip;
}
/// <summary>
/// Index of the course
/// </summary>
public CourseIndex index;
/// <summary>
/// The course title
/// </summary>
public string title;
/// <summary>
/// A short description of the course
/// </summary>
public string description;
/// <summary>
/// Reference to the course thumbnail
/// </summary>
public Sprite thumbnail;
/// <summary>
/// List of all learnable words/letters
/// </summary>
public List<Learnable> learnables = new List<Learnable>();
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f6b23e64e6ffb12459ed4f37d7305852
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 96fe8874f9754b545ae25fb826312ebc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,43 @@
using UnityEngine;
/// <summary>
/// Class for holding all (static) data about a certain minigame
/// </summary>
[CreateAssetMenu(menuName = "Create new Scriptable/Minigame")]
public class Minigame : ScriptableObject
{
/// <summary>
/// Index of the minigame
/// </summary>
public MinigameIndex index;
/// <summary>
/// The minigame title
/// </summary>
public string title;
/// <summary>
/// A short description of the minigame
/// </summary>
public string description;
/// <summary>
/// Whether or not the game needs a theme to be selected
/// </summary>
public bool needsTheme;
/// <summary>
/// Reference to the minigame thumbnail
/// </summary>
public Sprite thumbnail;
/// <summary>
/// The path to the minigame starting scene (<c>path == $"Assets/{minigameEntryPoint}"</c>)
/// </summary>
public string minigameEntryPoint;
/// <summary>
/// An explanation on how to play the game and score points
/// </summary>
public string controls;
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d7809d135a59849458ccb29ffad535c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Keep track off installed minigames
/// </summary>
[CreateAssetMenu(menuName = "Create new Scriptable/MinigameList")]
public class MinigameList : ScriptableObject
{
/// <summary>
/// Index of the active/to be loaded/current minigame
/// </summary>
public int currentMinigameIndex = 0;
/// <summary>
/// List of all installed minigames
/// </summary>
public List<Minigame> minigames = new List<Minigame>();
/// <summary>
/// Get a minigame by MinigameIndex
/// </summary>
/// <param name="minigameIndex">MinigameIndex of the minigame, each unique minigame has a unique MinigameIndex</param>
/// <returns>Minigame associated with this index, null if no minigame was found</returns>
public Minigame GetMinigameByIndex(MinigameIndex minigameIndex)
{
return minigames.Find((m) => m.index == minigameIndex);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3976e4310b716de4eb24f1916c10ff3d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,7 +1,7 @@
using System;
/// <summary>
/// Score class TODO: Move to separate file
/// Score class
/// </summary>
[Serializable]
public class Score