Resolve WES-131-Feedback-REfactor
This commit is contained in:
committed by
Dries Van Schuylenbergh
parent
b955d2164c
commit
a808e73a29
40
Assets/MediaPipeUnity/Scripts/AbstractFeedback.cs
Normal file
40
Assets/MediaPipeUnity/Scripts/AbstractFeedback.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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 sign predictor
|
||||
/// </summary>
|
||||
public SignPredictor signPredictor;
|
||||
/// <summary>
|
||||
/// The function that is called by the publisher on all its listeners
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerator ProcessIncomingCall()
|
||||
{
|
||||
yield return StartCoroutine(UpdateFeedback());
|
||||
}
|
||||
/// <summary>
|
||||
/// A function to add yourself as listener to the signPredictor you are holding
|
||||
/// </summary>
|
||||
public void AddSelfAsListener()
|
||||
{
|
||||
signPredictor.listeners.Add(this);
|
||||
}
|
||||
/// <summary>
|
||||
/// The function that holds the logic to process the new probabilities of the signPredictor
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected abstract IEnumerator UpdateFeedback();
|
||||
}
|
||||
Reference in New Issue
Block a user