Resolve WES-95 "User progress"
This commit is contained in:
@@ -1,58 +0,0 @@
|
||||
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>();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6b23e64e6ffb12459ed4f37d7305852
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,19 +0,0 @@
|
||||
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>();
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96fe8874f9754b545ae25fb826312ebc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -150,7 +150,7 @@ public class TemplateCourse : MonoBehaviour
|
||||
|
||||
// Create entry in current user for keeping track of progress
|
||||
user = userList.GetCurrentUser();
|
||||
progress = user.courses.Find((p) => p != null && p.Get<CourseIndex>("courseIndex") == course.index);
|
||||
progress = user.GetCourseProgress(course.index);
|
||||
if (progress == null)
|
||||
{
|
||||
progress = new Progress();
|
||||
|
||||
Reference in New Issue
Block a user