Implemented changes to use abstract feedback
This commit is contained in:
64
Assets/MediaPipeUnity/Scripts/AbstractFeedback.cs
Normal file
64
Assets/MediaPipeUnity/Scripts/AbstractFeedback.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using DigitalRuby.Tween;
|
||||
using Mediapipe.Unity.Tutorial;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Class to display feedback during a course
|
||||
/// </summary>
|
||||
public abstract class AbstractFeedback : MonoBehaviour, Listener
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to the feedback field
|
||||
/// </summary>
|
||||
public TMP_Text feedbackText;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the progress bar
|
||||
/// </summary>
|
||||
public Slider feedbackProgress;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the progress bar image, so we can add fancy colors
|
||||
/// </summary>
|
||||
public Image feedbackProgressImage;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the sign predictor
|
||||
/// </summary>
|
||||
public SignPredictor signPredictor;
|
||||
|
||||
/// <summary>
|
||||
/// Timer to keep track of how long a incorrect sign is performed
|
||||
/// </summary>
|
||||
protected DateTime timer;
|
||||
|
||||
/// <summary>
|
||||
/// Current predicted sign
|
||||
/// </summary>
|
||||
protected string predictedSign = null;
|
||||
|
||||
/// <summary>
|
||||
/// Previous incorrect sign, so we can keep track whether the user is wrong or the user is still changing signs
|
||||
/// </summary>
|
||||
protected string previousIncorrectSign = null;
|
||||
|
||||
public void ProcessIncomingCall()
|
||||
{
|
||||
//UpdateFeedback2();
|
||||
StartCoroutine(UpdateFeedback());
|
||||
}
|
||||
|
||||
public void AddSelfAsListener()
|
||||
{
|
||||
signPredictor.listeners.Add(this);
|
||||
}
|
||||
|
||||
public void Empty() { }
|
||||
|
||||
protected abstract IEnumerator UpdateFeedback();
|
||||
}
|
||||
Reference in New Issue
Block a user