IEnumerator loadAfterZoom() { showPanels.HideMenu(); yield return(new WaitForSeconds(animationSpeed)); LoadDelayed(); }
public void StartButtonClicked() { //If changeMusicOnStart is true, fade out volume of music group of AudioMixer by calling FadeDown function of PlayMusic, using length of fadeColorAnimationClip as time. //To change fade time, change length of animation "FadeToColor" if (changeMusicOnStart) { playMusic.FadeDown(fadeColorAnimationClip.length); } //If changeScenes is true, start fading and change scenes halfway through animation when screen is blocked by FadeImage if (changeScenes) { //LoadSceneNumber(0); //Use invoke to delay calling of LoadDelayed by half the length of fadeColorAnimationClip Invoke("LoadDelayed", fadeColorAnimationClip.length * .5f); //Set the trigger of Animator animColorFade to start transition to the FadeToOpaque state. animColorFade.SetTrigger("fade"); showPanels.HideMenu(); LoadSceneNumber(0); //LoadDelayed(); } //If changeScenes is false, call StartGameInScene else { //Call the StartGameInScene function to start game without loading a new scene. StartGameInScene(); } }
/* * void OnEnable() * { * SceneManager.sceneLoaded += SceneWasLoaded; * } * * void OnDisable() * { * SceneManager.sceneLoaded -= SceneWasLoaded; * }*/ public void LoadDelayed() { inMainMenu = false; showPanels.HideMenu(); SceneManager.LoadScene(sceneToStart); }
public void LoadDelayed() { inMainMenu = false; showPanels.HideMenu(); Application.LoadLevel(BasicLoad); }
public void LoadDelayed() { inMainMenu = false; showPanels?.HideMenu(); SceneManager.LoadScene(sceneToStart); Invoke("ResetScript", fadeColorAnimationClip.length * .5f); }
IEnumerator waitForLoad() { Debug.Log("Starting to wait"); yield return(new WaitForSeconds(2)); SceneManager.LoadScene("Level 1"); fadeOutImageCanvasGroup.alpha = 0; showPanels.HideMenu(); Debug.Log("Loaded Level 1 set alpha to 0"); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings Application.LoadLevel("levelintro"); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings SceneManager.LoadScene(sceneToStart); }
void ReturnToMenu() { playMusic.PlaySelectedMusic(0, musicFadeInTime); if (PlayerPrefs.HasKey("GameState") && PlayerPrefs.GetString("GameState") == "GameOver") { showPanels.HideMenu(); showPanels.ShowGameOverPanel(); PlayerPrefs.DeleteKey("GameState"); } FadeIn(); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Begin loading the game scene StartCoroutine(LoadDelayedAsync()); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings SceneManager.LoadScene(sceneToStart); StartCoroutine(FadeCanvasGroupAlpha(fadeOutImageCanvasGroup.alpha, 0f, fadeOutImageCanvasGroup)); }
public IEnumerator LoadDelayed(float delay) { //Load the selected scene, by scene index number in build settings AsyncOperation async = SceneManager.LoadSceneAsync(sceneToStart); yield return(async); //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); }
public void LoadDelayedNextScene2() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //change game state to playing GameStateMachine.myGameState = GameStateMachine.GameState.PLAYING; //Load the selected scene, by scene index number in build settings SceneManager.LoadScene(scene2); }
private void LoadDelayedGame() { // Hide the main menu UI element showPanels.HideMenu(); showPanels.HideVersion(); // Hide the Level panel UI element showPanels.HideLevelsPanel(); m_bThanksPanel = false; // Hide the Congratulations panel UI element and // show the HUD panel UI element Pause.current.UnCongratulation(); // Load the selected scene, by scene index number in build settings StartCoroutine(AsyncLoading(sceneToGo)); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); playMusic.musicSource.Stop(); // added for Hex-a-cute //Load the selected scene, by scene index number in build settings #if UNITY_5_3 SceneManager.LoadScene(sceneToStart); #endif }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings Camera.main.enabled = false; GameObject background = GameObject.FindGameObjectWithTag("Background"); background.active = false; SceneManager.LoadSceneAsync(sceneToStart, LoadSceneMode.Additive); }
public void StartButtonClicked() { showPanels.HideMenu(); if (changeScenes) { Invoke("LoadDelayed", fadeColorAnimationClip.length * 2f); animColorFade.SetTrigger("fade"); } else { StartGameInScene(); } }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); if (changeMusicOnStart) { PlayNewMusic(); } //Load the selected scene, by scene index number in build settings StartCoroutine(LoadAsynchronously(sceneToStart)); //SceneManager.LoadScene (sceneToStart); }
public void HideDelayed() { //changed this during migration of functions, if performance issues become problematic, revisit this===================== showPanels = FindObjectOfType <ShowPanels>(); //Hide the main menu UI element after fading out menu for start game in scene showPanels.HideMenu(); }
public IEnumerator HideDelayed() { yield return(new WaitForSecondsRealtime(FadeAlphaAnimationClip.length)); _showPanels.HideMenu(); AnimMenuAlpha.ResetTrigger("fade"); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings //SceneManager.LoadScene(sceneToStart); //SceneManager. //SceneManager.Loa if (PhotonNetwork.isMasterClient) { level.loadScene("First Scene"); } }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); logo.SetActive(false); //Load the selected scene, by scene index number in build settings #if UNITY_5_3_OR_NEWER SceneManager.LoadScene(sceneToStart); #else Application.LoadLevel(sceneToStart); #endif }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings Application.LoadLevel(sceneToStart); animMenuAlpha.SetTrigger("fade"); //Wait until game has started, then hide the main menu Invoke("HideDelayed", fadeAlphaAnimationClip.length); Debug.Log("Game started in same scene! Put your game starting stuff here."); //showPanels.DisableMenuButtons(); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings if (_navigatingToGame) { navigator.NavigateToGameScene(); } else { navigator.NavigateToVictoryScene(); } StartCoroutine(FadeCanvasGroupAlpha(1f, 0f, fadeOutImageCanvasGroup)); }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); //Load the first scene if we're in the menu, otherwise reload the current scene. int currentScene = SceneManager.GetActiveScene().buildIndex; if (currentScene == 0) { SceneManager.LoadScene(sceneToStart); } else { SceneManager.LoadScene(currentScene); } }
public void Start() { m_ShowPanels = GameObject.Find("Canvas").GetComponent <ShowPanels>(); m_Quit = GameObject.Find("Canvas").GetComponent <QuitApplication>(); m_SoundFx = GameObject.Find("Canvas/SoundFx").GetComponent <AudioSource>(); m_Anim = GetComponent <Animator>(); onClick.RemoveAllListeners(); switch (button) { case ButtonType.Level: onClick.AddListener(() => { m_SoundFx.clip = soundClip; m_SoundFx.Play(); m_ShowPanels.HideMenu(); m_ShowPanels.ShowLevelsPanel(); }); break; case ButtonType.Option: onClick.AddListener(() => { m_SoundFx.clip = soundClip; m_SoundFx.Play(); m_ShowPanels.ShowOptionsPanel(); m_ShowPanels.HideMenu(); }); break; case ButtonType.Quit: onClick.AddListener(() => { m_SoundFx.clip = soundClip; m_SoundFx.Play(); m_Quit.Quit(); }); break; } m_Anim.SetTrigger("Hide"); }
// Update is called once per frame void Update() { showPanels = GameObject.FindGameObjectWithTag("UI").GetComponent <ShowPanels>(); if (Input.GetKey(KeyCode.LeftControl) & (Input.GetKey(KeyCode.R))) // Change this if you want to start the experiment some other way { SceneManager.LoadScene("Begin 1"); showPanels.HideMenu(); } }
public void LoadDelayed() { //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //changed this during migration of functions, if performance issues become problematic, revisit this===================== showPanels = FindObjectOfType <ShowPanels>(); //Hide the main menu UI element showPanels.HideMenu(); //Load the selected scene, by scene index number in build settings SceneManager.LoadScene(sceneToStart); }
private ShowPanels showPanels; //Reference to ShowPanels script on UI GameObject, to show and hide panels void Awake() { //Get a reference to ShowPanels attached to UI object showPanels = GetComponent <ShowPanels> (); //Get a reference to PlayMusic attached to UI object playMusic = GetComponent <PlayMusic> (); // **** ver se é o local correto; showPanels.HideGameplayPanel(); showPanels.ShowIntro(); showPanels.HideMenu(); showPanels.HideEndGamePanel(); }
public void StartButtonClicked() { camerasss.transform.position = startingPosition; //If changeMusicOnStart is true, fade out volume of music group of AudioMixer by calling FadeDown function of PlayMusic //To change fade time, change length of animation "FadeToColor" if (menuSettingsData.musicLoopToChangeTo != null) { playMusic.FadeDown(menuSettingsData.menuFadeTime); } //If changeScenes is true, start fading and change scenes halfway through animation when screen is blocked by FadeImage if (sceneToStart != 0) { StartCoroutine(FadeCanvasGroupAlpha(0f, 1f, fadeOutImageCanvasGroup)); StartCoroutine(LoadNextScene(sceneToStart)); //Pause button now works if escape is pressed since we are no longer in Main menu. inMainMenu = false; //Hide the main menu UI element showPanels.HideMenu(); } }