Resolve WES-133 "Multiple choice"
This commit is contained in:
committed by
Jelle De Geest
parent
04d9a4bf2b
commit
4e9d801e61
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user