/// <summary> /// Update is a predefined function in unity and is called at every frame. /// The time value decreases as appropriate at every frame /// </summary> public void Update() { // deltaTime is to make current time decrease by each second instead of each frame currentTime = currentTime -= Time.deltaTime; // Convert the float time value into a string to display on the screen // timerText.text displays the time with 1 decimal place due to the "1f" argument to ToString() timerText.text = currentTime.ToString("f1"); // Make the text red if there are less than 5 seconds left if (currentTime <= HIGHLIGHTED_TIME) { timerText.color = HIGHLIGHTED_COLOUR; } // If the time reaches 0, move to the next scene. // Since it is possible that the time calculated may not ever reach the exact value of 0, // Check for when the currentTime value is below 0.1 if (currentTime < 0.1) { currentTime = 0; // Function to move to the menu scene SceneSwitcher.MoveToScene(SceneName.MENU_SCENE); } }
/// <summary> /// JumpToResult controls the system to jump to the Result scene. /// It will be trigger as the "Check Result" button is clicked. /// </summary> public void JumpToResult() { SceneSwitcher.MoveToScene(SceneName.RESULT_SCENE); }
/// <summary> /// JumpToSaveOneBallGame controls the system to jump to the SaveOneBall /// game instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToSaveOneBallGame() { SceneSwitcher.MoveToScene(SceneName.SAVE_ONE_BALL_INSTRUCTIONS_SCENE); }
/// <summary> /// JumpToSaveOneBallGame controls the system to jump to the SaveOneBall /// game instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToJudgeTheBallGame() { SceneSwitcher.MoveToScene(SceneName.JUDGE_THE_BALL_INSTRUCTIONS_SCENE); }
/// <summary> /// JumpToCatchTheBallGame controls the system to jump to the CatchTheBall /// game instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToCatchTheBallGame() { SceneSwitcher.MoveToScene(SceneName.CATCH_THE_BALL_INSTRUCTIONS_SCENE); }
/// <summary> /// JumpToImageHitGame controls the system to jump to the ImageHit game instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToImageHitGame() { SceneSwitcher.MoveToScene(SceneName.IMAGEHIT_INSTRUCTIONS_SCENE); }
/// <summary> /// JumpToBalloonsGame controls the system to jump to the Balloons game instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToBalloonsGame() { SceneSwitcher.MoveToScene(SceneName.BALLOONS_INSTRUCTIONS_SCENE); }
/// <summary> /// JumpToSquaresGame controls the system to jump to the Squares instruction scene. /// It will be triggered as the game button is clicked. /// </summary> public void JumpToSquaresGame() { SceneSwitcher.MoveToScene(SceneName.SQUARES_INSTRUCTIONS_SCENE); }
// Game jumper functions start: //-------------------------------------------------------- /// <summary> /// JumpToCTFGame controls the system to jump to the Catch The Thief game instruction scene. /// It will will be triggered as the game button is clicked. /// </summary> public void JumpToCTFGame() { SceneSwitcher.MoveToScene(SceneName.CATCHTHETHIEF_INSTRUCTIONS_SCENE); }