Add formatting rules

This commit is contained in:
Dries Van Schuylenbergh
2023-03-10 09:21:11 +00:00
parent 6d762a63f7
commit 26f3322e4e
30 changed files with 975 additions and 160 deletions

View File

@@ -3,32 +3,56 @@ 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]
// Small class to hold information about a single learnable (e.g., a word or a letter)
public class Learnable
{
// Name of the word/letter to learn
/// <summary>
/// Name of the word/letter to learn
/// </summary>
public string name;
// Sprite of this word/letter
/// <summary>
/// Sprite of this word/letter
/// </summary>
public Sprite image;
// Example video clip
/// <summary>
/// Example video clip
/// </summary>
public VideoClip clip;
}
[Header("Course info")]
// Course index
/// <summary>
/// Index of the course
/// </summary>
public CourseIndex index;
// Course title
/// <summary>
/// The course title
/// </summary>
public string title;
// Short desciption of the course
/// <summary>
/// A short description of the course
/// </summary>
public string description;
// Thumbnail of the course
/// <summary>
/// Reference to the course thumbnail
/// </summary>
public Sprite thumbnail;
[Header("Learnable words")]
// List of learnable words/letters
/// <summary>
/// List of all learnable words/letters
/// </summary>
public List<Learnable> learnables = new List<Learnable>();
}

View File

@@ -1,5 +1,7 @@
// TODO: add other courses
/// <summary>
/// Enum for easy indexing and checking if a course is of a certain kind
/// </summary>
public enum CourseIndex
{
FINGERSPELLING

View File

@@ -1,14 +1,19 @@
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Keep track of all courses
/// </summary>
[CreateAssetMenu(menuName = "Create new Scriptable/CourseList")]
public class CourseList : ScriptableObject
{
[Header("Current Course")]
// Index of the current course
/// <summary>
/// Index of the active/to be loaded/current course
/// </summary>
public int currentCourseIndex = 0;
[Header("Courses")]
// List of courses
/// <summary>
/// List of all installed courses
/// </summary>
public List<Course> courses = new List<Course>();
}

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.Video;
using UnityEngine.UI;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;
public class StartPause : MonoBehaviour
{

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Webcam : MonoBehaviour
{
@@ -13,7 +13,8 @@ public class Webcam : MonoBehaviour
public GameObject popup;
public TextMeshProUGUI dynamic;
void Awake(){
void Awake()
{
popup.SetActive(false);
WebCamDevice device = WebCamTexture.devices[camdex];
@@ -55,20 +56,25 @@ public class Webcam : MonoBehaviour
SceneManager.LoadScene(sceneName);
}
public void Show_feedback(){
if(popup.activeSelf){
public void Show_feedback()
{
if (popup.activeSelf)
{
dynamic.text = "";
popup.SetActive(false);
return;
}
double index = UnityEngine.Random.value;
if(index < 0.5){
if (index < 0.5)
{
dynamic.text = "Poor";
}
else if(index > 0.8){
else if (index > 0.8)
{
dynamic.text = "Excellent";
}
else{
else
{
dynamic.text = "Good";
}
popup.SetActive(true);