Resolve WES-133 "Multiple choice"

This commit is contained in:
Tibe Habils
2023-04-10 15:05:11 +00:00
committed by Jelle De Geest
parent 04d9a4bf2b
commit 4e9d801e61
49 changed files with 3310 additions and 1244 deletions

View File

@@ -10,6 +10,9 @@ public class PanelWithVideoAndImage : MonoBehaviour
public GameObject previewMessage;
public bool isPreview;
public Sprite playSprite;
public Sprite pauseSprite;
/// <summary>
/// Reference to instructional video player
/// </summary>
@@ -39,18 +42,12 @@ public class PanelWithVideoAndImage : MonoBehaviour
/// </summary>
public Image feedbackProgressImage;
/// <summary>
/// Reference to the image for displaying the current words sprite
/// </summary>
public TMP_Text signName;
public List<Learnable> signs;
public int currentSignIndex;
public void Display()
{
Learnable currentSign = signs[currentSignIndex];
signName.text = currentSign.name;
videoPlayer.aspectRatio = VideoAspectRatio.FitInside;
videoPlayer.clip = currentSign.clip;
videoPlayer.Play();
@@ -77,10 +74,18 @@ public class PanelWithVideoAndImage : MonoBehaviour
public void TogglePlayPause()
{
if (!videoPlayer.isPlaying)
// Play video and hide button
{
// Play video and switch sprite of button
playButton.sprite = pauseSprite;
videoPlayer.Play();
}
else
// Pause video and show button
{
// Pause video and and switch sprite of button
playButton.sprite = playSprite;
videoPlayer.Pause();
}
}
}