Merge branch 'WES-51-fingerspelling-result-view' into 'development'
WES-51-fingerspelling-result-view See merge request wesign/unity-application!39
This commit was merged in pull request #39.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@@ -78,6 +79,30 @@ public class StartPause : MonoBehaviour
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private int correctWords = 0;
|
private int correctWords = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The "finished" screen
|
||||||
|
/// </summary>
|
||||||
|
public GameObject ResultPanel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Button to go back to courses list
|
||||||
|
/// </summary>
|
||||||
|
public Button CoursesButton;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Webcam class to close the webcam when the course is finished
|
||||||
|
/// </summary>
|
||||||
|
public Webcam Webcam;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DateTime containint the start moment
|
||||||
|
/// </summary>
|
||||||
|
private DateTime startMoment;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reference to the timeSpent UI
|
||||||
|
/// </summary>
|
||||||
|
public TextMeshProUGUI timeSpent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is called when the script is initialised.
|
/// This function is called when the script is initialised.
|
||||||
@@ -108,6 +133,11 @@ public class StartPause : MonoBehaviour
|
|||||||
title.text = course.name;
|
title.text = course.name;
|
||||||
NextVideo();
|
NextVideo();
|
||||||
NextImage();
|
NextImage();
|
||||||
|
|
||||||
|
// Hide the result panel
|
||||||
|
ResultPanel.SetActive(false);
|
||||||
|
// Set the startTime
|
||||||
|
startMoment = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
// These two functions generate video and image from files
|
// These two functions generate video and image from files
|
||||||
@@ -198,8 +228,18 @@ public class StartPause : MonoBehaviour
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void FinishCourse()
|
public void FinishCourse()
|
||||||
{
|
{
|
||||||
// TODO: update progress (maybe this can also be at the `NextSign()`-method)
|
// Show the "finished" screen
|
||||||
progress.AddOrUpdate<float>("courseProgress", correctWords / maxWords);
|
ResultPanel.SetActive(true);
|
||||||
|
|
||||||
|
// Set the total time spent UI
|
||||||
|
TimeSpan time = DateTime.Now - startMoment;
|
||||||
|
timeSpent.text = time.ToString(@"hh\:mm\:ss");
|
||||||
|
|
||||||
|
// Link button
|
||||||
|
//CoursesButton.onClick.AddListener(() => { SceneManager.LoadScene("Assets/Common/Scenes/CoursesScreen.unity"); });
|
||||||
|
CoursesButton.onClick.AddListener(() => { Webcam.LoadScene("Assets/Common/Scenes/CoursesScreen.unity"); });
|
||||||
|
|
||||||
|
progress.AddOrUpdate<float>("courseProgress", 1f);
|
||||||
userList.Save();
|
userList.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class Webcam : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The notmal sceneChanger cannot be used here since the camera also needs to be stopped.
|
/// The normal sceneChanger cannot be used here since the camera also needs to be stopped.
|
||||||
/// This extra functionality is implemented in this function
|
/// This extra functionality is implemented in this function
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sceneName"> The path for the scene you want to travel to, assuming root-directory is Assets</param>
|
/// <param name="sceneName"> The path for the scene you want to travel to, assuming root-directory is Assets</param>
|
||||||
|
|||||||
Reference in New Issue
Block a user