// Called at the start of the scene, so that all variables start at zero public void ResetScenario(Scenario scenario, ModeStop modeStop, ModeFeedback modeFeedback) { // Enable input manager & tell them what modes to use if (input != null) { input.CurrentMode = modeStop; } else if (vr_hand != null) { vr_hand.enabled = true; hand_renderer.enabled = true; vr_hand.CurrentMode = modeStop; pointer.enabled = false; pointer_renderer.enabled = false; } // Set the current scenario, and set the modes to that scenario currentScenario = scenario; currentScenario.StartScenario(modeStop, modeFeedback); // Set the feedback mode ui_feedback.CurrentMode = modeFeedback; if (modeFeedback is ModeFeedbackDuring) { ui_ingame.gameObject.SetActive(true); } // Start at 0 seconds _countSeconds = 0; }
// Called from menu when the user starts the scenario (when not showing a video) public void StartTime(Scenario thisScenario, ModeStop modeStop, ModeFeedback modeFeedback) { // Start timer for 60 seconds StartTimer(60); _timerIsRunning = true; // Set the scenario and modes given ResetScenario(thisScenario, modeStop, modeFeedback); }
// Called when opening the scene to set the modes public void StartScenario(ModeStop modeStop, ModeFeedback modeFeedback) { // Tell each hitbox which modes the scene will be using foreach (Hitbox item in hitboxList) { item.StartHitbox(modeStop, modeFeedback); } // Reset the scores Scores.Reset(); }
// Called from menu when the user starts the scenario (when showing a video) public void StartVideo(Scenario thisScenario, ModeStop modeStop, ModeFeedback modeFeedback) { // Stop the video player, set new video, start playing the new video (stop the video to start the new video from the beginning) _vPlayer.Stop(); _vPlayer.clip = thisScenario.Clip; _vPlayer.Play(); // Start the timer for the scenario time StartTimer(thisScenario.Time); _videoIsRunning = true; // Set the scenario and modes given ResetScenario(thisScenario, modeStop, modeFeedback); }
// Called when the scene is started to set the modes that are being used public void StartHitbox(ModeStop mStop, ModeFeedback mFeedback) { // Set the mode modeStop = mStop; // Reset all the variables neccessary _currentPositon = null; _nextPosition = null; hasbeenselected = false; hastakenbreak = false; // Tell the result script which feedback mode to use _boxResult.ResetResults(mFeedback); }
// UI_SelectMode uses this to select the modes chosen by the user public void SelectMode(ModeStop mStop, ModeFeedback mFeedback) { if (!_canUseScript) { return; } // Storing the modes modeStop = mStop; modeFeedback = mFeedback; // Start the time system on video or time, based on the video toggle if (testVideo) { time.StartVideo(thisScenario, mStop, mFeedback); } else { time.StartTime(thisScenario, mStop, mFeedback); } gameObject.SetActive(false); }
// Pressing one of the mode buttons private void StartTimer(ModeStop mStop) { if (!_canUseScript) { return; } // Store the mode modeStop = mStop; // Set the feedback mode according to the toggle if (toggle_feedback.isOn) { modeFeedback = new ModeFeedbackDuring(); } else { modeFeedback = new ModeFeedbackAfter(); } // Find which scenario is selected int index = dropdown_scenarios.value; Scenario thisScenario = scenarios[index]; // Start the time system on video or time, based on the video toggle if (toggle_video.isOn) { time.StartVideo(thisScenario, modeStop, modeFeedback); } else { time.StartTime(thisScenario, modeStop, modeFeedback); } gameObject.SetActive(false); }