void Update() { if (Input.GetKeyDown(KeyCode.Space) && canGoToSurvey) { Application.OpenURL("https://docs.google.com/forms/d/1YV2OpAa3DlDGKMnicz97-1V5Shs8iR6eQgThn0fjRzE"); Application.Quit(); } if (Input.GetKeyDown(KeyCode.P)) { FlipFadeToBattle(); } //Fadeout or Fadein? if (!fadeOut) { thisImage.fillAmount -= 0.02f; if (thisImage.fillAmount <= 0.0f) { if (transitionIntoACutscene) //When it's a cutscene, fade in call cutscene, fade out { transitionIntoACutscene = false; } } } else { thisImage.fillAmount += 0.02f; if (thisImage.fillAmount >= 1.0f) { if (transitionToBattle) { transitionToBattle = false; TransitionIntoBattle(); fadeOut = false; } else if (transitionToSecondBossFight) { if (transitionOutOfACutscene == true) //If we're transitioning into another boss, chances are we've come from a cutscene { transitionOutOfACutscene = false; } transitionToSecondBossFight = false; TransitionToSecondBossFight(); fadeOut = false; } else if (transitionToVictory) { transitionToVictory = false; TransitionIntoVictory(); // uiBtl.StartShowingEndScreen(true); //Show the victory screen stats now } else if (transitionToDefeat) { transitionToDefeat = false; TransitionIntoDefeat(); //uiBtl.StartShowingEndScreen(false); //Show the defeat screen } else if (transitionToWorldMap) { //Debug.Log("Transition is now falseee"); transitionToWorldMap = false; if (WMEnemy.startTutorial) //Is the fight we're in a tutorial? { SceneManager.UnloadSceneAsync(SceneManager.GetSceneByName("Queue Scene 2")); WMEnemy.startTutorial = false; } else { SceneManager.UnloadSceneAsync(SceneManager.GetSceneByName("Queue Scene")); } audioManager.PlayThePreviousSong(); NewWMEnemy.isActive = true; CutsceneManager.instance.isActive = false; } else if (transitionToEndTest) { transitionToEndTest = false; endTestPanel.gameObject.SetActive(true); canGoToSurvey = true; } else if (transitionIntoACutscene) { fadeOut = !fadeOut; //Fade out again //Debug.Log("Transition into a cutscene works"); if (cutsceneTriggerRef != null) { Debug.Log("Working"); cutsceneTriggerRef.TriggerCutscene(); //Load the cutscene while fading out audioManager.PlayThisClip("Cutscene1"); cutsceneTriggerRef = null; } } else if (transitionOutOfACutscene) { fadeOut = !fadeOut; CutsceneManager.instance.End(); transitionOutOfACutscene = false; audioManager.PlayThePreviousSong(); } else if (transitionToMainMenu) { GameManager.instance.DestoryUndestroyables(); transitionToMainMenu = false; SceneManager.LoadScene("Main Menu"); } } } }