This commit is contained in:
Jelle De Geest
2023-04-26 19:04:34 +02:00
parent 172938cec8
commit 47f8b96122
1004 changed files with 60756 additions and 117444 deletions

View File

@@ -0,0 +1,49 @@
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class PanelWithImage : MonoBehaviour
{
public GameObject feedbackProgressObject;
public GameObject previewMessage;
public bool isPreview;
/// <summary>
/// Reference to the image for displaying the current words sprite
/// </summary>
public Transform signImageContainer;
public GameObject signImagePrefab;
public RawImage webcamScreen;
/// <summary>
/// Reference to the feedback field
/// </summary>
public TMP_Text feedbackText;
/// <summary>
/// Reference to the progress bar
/// </summary>
public Slider feedbackProgressBar;
/// <summary>
/// Reference to the progress bar image, so we can add fancy colors
/// </summary>
public Image feedbackProgressImage;
public List<Learnable> signs;
public int currentSignIndex;
public void Display()
{
Learnable currentSign = signs[currentSignIndex];
feedbackProgressObject.SetActive(!isPreview);
previewMessage.SetActive(isPreview);
GameObject sprite = GameObject.Instantiate(signImagePrefab, signImageContainer);
sprite.GetComponent<Image>().sprite = currentSign.image;
}
}