diff --git a/Assets/PresentationManager/Scripts/SlideTimingTracker.cs b/Assets/PresentationManager/Scripts/SlideTimingTracker.cs new file mode 100644 index 0000000..8317a3c --- /dev/null +++ b/Assets/PresentationManager/Scripts/SlideTimingTracker.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +public class SlideTimingTracker : MonoBehaviour +{ + // Start is called once before the first execution of Update after the MonoBehaviour is created + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/PresentationManager/Scripts/SlideTimingTracker.cs.meta b/Assets/PresentationManager/Scripts/SlideTimingTracker.cs.meta new file mode 100644 index 0000000..4f9d11b --- /dev/null +++ b/Assets/PresentationManager/Scripts/SlideTimingTracker.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3e2c92481dbfdea4283ae5d18a6933cf \ No newline at end of file diff --git a/Assets/PresentationManager/Scripts/SlideshowManager.cs b/Assets/PresentationManager/Scripts/SlideshowManager.cs index c49d32d..df17800 100644 --- a/Assets/PresentationManager/Scripts/SlideshowManager.cs +++ b/Assets/PresentationManager/Scripts/SlideshowManager.cs @@ -1,13 +1,26 @@ using UnityEngine; +using UnityEngine.InputSystem.Controls; using UnityEngine.UI; public class SlideshowManager : MonoBehaviour { [SerializeField] Canvas slideshow; Image[] slides; + float[] slideTimers; Image currSlide; int currIndex = 0; bool isPresenting = false; + + public enum mode + { + menu, + training, + free, + practice + } + mode currMode = mode.menu; + mode selectedMode; + void Start() { slides = GetComponentsInChildren(); @@ -16,6 +29,12 @@ void Start() { image.enabled = false; } + + slideTimers = new float[slides.Length]; + for(int x = 0; x < slides.Length; x++) + { + slideTimers[x] = 0f; + } } // Update is called once per frame @@ -34,6 +53,39 @@ void Update() { PrevSlide(); } + + if (isPresenting) + { + slideTimers[currIndex] += Time.deltaTime; + } + + // Select modes + if (Input.GetKeyDown(KeyCode.I)) + { + selectedMode = mode.training; + Debug.Log("TRAINING mode selected"); + } + + if (Input.GetKeyDown(KeyCode.O)) + { + selectedMode = mode.free; + Debug.Log("FREE mode selected"); + } + + if (Input.GetKeyDown(KeyCode.P)) + { + selectedMode = mode.practice; + Debug.Log("PRACTICE mode selected"); + } + + if (Input.GetKeyDown(KeyCode.M) && !isPresenting) + { + currMode = selectedMode; + Debug.Log(currMode + " was confirmed."); + } + + + } public void StartPresentation() @@ -42,6 +94,11 @@ public void StartPresentation() currIndex = 0; currSlide = slides[currIndex]; currSlide.enabled = true; + for (int x = 0; x < slides.Length; x++) + { + slideTimers[x] = 0f; + } + } public void NextSlide() @@ -79,5 +136,18 @@ public void EndPresentation() isPresenting = false; currIndex = 0; currSlide = null; + + for (int x = 0; x < slides.Length; x++) + { + float time = slideTimers[x]; + int minutes = Mathf.FloorToInt(time / 60); + int seconds = Mathf.FloorToInt(time % 60); + Debug.Log("Slide " + x + " time is: " + minutes + "m and " + seconds + " seconds."); + } + } + + public float[] getSlideTime() + { + return slideTimers; } }