/// <summary> /// This checks if the cards are initialised or not /// when the mouse is clicked then calls the function checkCards. /// </summary> void Update() { if (_matches == 0) { if (playAudio) { sound.PlayOneShot(winning); playAudio = false; } lvlFM.OnLevelFinished(); } if (!_init) { initializeCards(); } if (Input.GetMouseButtonUp(0)) { checkCards(); } if (_matches != cards.Length / 2) { stopAllAnimations(); } if (finishedTutorial) { enableAllCards(); } }
/// <summary> /// Increments the counter. /// </summary> private void incrementTheCounter() { counter++; incrementCounter = false; if (counter == 11) { lvlFM.OnLevelFinished(); // display success window } }
/// <summary> /// Moves to next scene. /// </summary> public void moveToNextScene() { if (SceneManager.GetActiveScene().name == "CremeApplication") { SceneManager.LoadScene("InjectionBaby", LoadSceneMode.Single); } else if (SceneManager.GetActiveScene().name == "InjectionBaby") { scoreSlider.SetActive(false); lvlFM.OnLevelFinished(); } }
void Update() { changeSprite(); if (gameWon) { lvlFM.OnLevelFinished(); } if (bubbleScript.isFirstPinkBubbleSecondClicked) { bottleEnabled = true; } }
void doUpdate() { if (timeStillRemaining()) { if (decreaseBar) { if (inRedZone()) { changeLoadingBarColorToRed(); } } updateLoadingBar(); } else { counter += Time.deltaTime; if (counter > 0.1) { lvlFM.OnLevelFinished(); counter = 0f; } } }
/// <summary> /// Method called when the level is cleared, used to move to the next stage. /// </summary> public void levelCleared() { levelOver = true; //Signals to the script that the game has ended cheerAudio.GetComponent <AudioSource>().Play(); lvlFM.OnLevelFinished(); }