private void onStartGame(GeneralEvent e) { _fader.FadeOut(FADE_TIME, () => { _onComplete(JamStateType.LOAD_GAMEPLAY); }); }
public void Pause() { Time.timeScale = 0; Show(pauseText); Show(pauseMenu); fader.FadeOut(fadeDuration, alpha); }
/// <summary> /// Scene을 불러옵니다. /// </summary> void Load() { _loading = true; _seSources[1].Play(); // 페이드 아웃을 진행합니다. _fader.FadeOut(1); }
private void onStartGame() { Singleton.instance.sessionFlags.gameContext = _createGameContext(); _fader.FadeOut(0.35f, () => { _stateMachine.ChangeState(TuckState.PASS_PLAY_GAMEPLAY); }); }
public void Restart() { GameManager.quitting = true; screenFader.FadeOut(delegate { SceneManager.LoadScene("GameScene"); }, 0.5f); Time.timeScale = 1; screenFader.CanvasGroup.blocksRaycasts = true; }
private void onGoToMainMenu() { Singleton.instance.networkManager.Disconnect(); _fader.FadeOut(0.35f, () => { _stateMachine.ChangeState(TacoTuesdayState.MAIN_MENU); }); }
public void GenereteMap() { _currentLevel++; _player.SetTurn(false); _fader.FadeOut(_currentLevel); UpdateLevel(); _proceduralBoard.GenerateMap(); GetRoguesAtScene(); }
/// <summary> /// 불러오기 코루틴입니다. /// </summary> /// <returns>불러오기 코루틴 반복자입니다.</returns> IEnumerator LoadMain() { // 비동기 불러오기를 시작합니다. AsyncOperation async = SceneManager.LoadSceneAsync(_loadingLevelName); // 비동기 불러오기가 완료될 때까지 fader의 동작을 관리합니다. while (async.isDone == false) { if (async.progress >= 0.9f) { break; } else if (_fadeRequested == false) { if (async.progress >= 0.6f) { fader.FadeOut(); _fadeRequested = true; } } /// _text.text = async.progress.ToString(); yield return(null); } /// _text.text = "Load Ended!"; SceneManager.LoadScene(_loadingLevelName); }
public void Play() { screenFader.FadeOut(delegate { SceneManager.LoadScene("GameScene"); }, 0.5f); screenFader.CanvasGroup.blocksRaycasts = true; }
public IEnumerator LoadScene(string level) { ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>(); GameObject bgm = GameObject.FindGameObjectWithTag("BGM"); float startTime = Time.realtimeSinceStartup; if (bgm != null) { bgm.GetComponent <BGMControl>().FadeOut(fadeDuration); } sf.FadeOut(fadeDuration); while (Time.realtimeSinceStartup < startTime + fadeDuration) { yield return(null); } SceneManager.LoadScene(level, LoadSceneMode.Single); sf.FadeIn(fadeDuration); isLoading = false; if (Time.timeScale != 1) { Time.timeScale = 1; } }
private void Death(bool doDestroy) // no need to handle the non destructive death, since it never happens { OnDeath?.Invoke(); anim.SetBool("isDead", true); pc.StopControl(); Debug.Log("stopped control"); rb.velocity = Vector2.zero; //prevent sliding coroutines.WaitThenExecute(1f, () => { sf.FadeIn(); }); coroutines.WaitThenExecute(2f, () => { hs.FullHealth(); tr.position = respawnPoint; }); coroutines.WaitThenExecute(3f, () => { sf.FadeOut(); }); coroutines.WaitThenExecute(3.5f, () => { anim.SetBool("isDead", false); }); coroutines.WaitThenExecute(3.8f, () => { pc.RegainControl(); Debug.Log("regained control"); }); //TODO finesse this }
public void OnEnter() { ScreenFader.FadeOut(); GameConductor.FreezePlayer(); MusicBox.ChangeMusic((int)Song.Final); MusicBox.Instance.FadeInTrack(1); CreditRoller.RollCredits(); }
public void LoadMenu(ScreenFader screenFader) { if (m_LoadMenuAction == null) { UpdateActions(); } screenFader.FadeOut(m_LoadMenuAction); }
public void ReloadLevel(ScreenFader screenFader) { if (m_LoadLevelAction == null) { UpdateActions(); } screenFader.FadeOut(m_LoadLevelAction); }
public IEnumerator StoryForDay(int day) { // fade to black var x = fader.FadeOut(4); while (x.MoveNext()) { yield return(null); } var text = new string[] {}; switch (day) { case 0: text = new[] { "Illumination", "The Nine Hundred and Ninety Seventh Night", "Scheherazade stands in the middle of the courtyard with lifeless eyes.", "You stare at her hopelessly, wondering if she would say another word to finish her hanging thought-", "But as always, the morning overtakes her and she remains silent." }; break; case 1: text = new[] { "The Nine Hundred and Ninety Eighth Night", "Scheherazade stands in the middle of the courtyard.", "\"It's morning. I must go to sleep.\"", "She won't look at you." }; break; case 2: break; case 3: break; default: break; } yield return(DisplayText(text, fullTele, true)); yield return(new WaitForSeconds(2)); fullTele.Clear(); x = fader.FadeIn(4); while (x.MoveNext()) { yield return(null); } yield return(DisplayText(new[] { "The Nine Hundred and Ninety Eighth Day", "" }, fullTele, true)); }
// UI Button public void ReloadLevel() { if (sceneReference != null) { sceneReference.ReloadLevel(screenFader); } else { screenFader.FadeOut(() => SceneManager.LoadSceneAsync(gameObject.scene.buildIndex)); } }
private IEnumerator LoadLevelSequence(LevelInfo levelInfo) { SoundManager.PlaySound(_sfxStartLevel); LevelProgress.CreateNewProgressData(levelInfo.DisplayName, levelInfo.SceneName, levelInfo.LevelRewards, levelInfo.HighestWaveDefeated); Save(); Debug.Log("--- Overworld: Exit ---"); yield return(new WaitForSeconds(_screenFader.FadeOut())); SceneManager.LoadScene(levelInfo.SceneName); }
private void Update() { if (Input.GetKeyDown(KeyCode.Alpha9)) { m_ScreenFader.FadeIn(); } if (Input.GetKeyDown(KeyCode.Alpha0)) { m_ScreenFader.FadeOut(); } if (Input.GetKeyDown(KeyCode.Alpha7)) { FadeAndLoadScene("Stage01"); } if (Input.GetKeyDown(KeyCode.Alpha8)) { FadeAndLoadScene("Stage02"); } }
// Corotina para aplicar fade out e fechar o jogo public IEnumerator ExitGame() { ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>(); sf.FadeOut(fadeDuration); yield return(new WaitForSeconds(fadeDuration)); //Diretiva de compilação para verificar se o jogo está rodando no editor da Unity #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif }
public void NextScene(string sceneName) { screenFader.FadeOut(() => { if (sceneName[0] == '_') { PrepareScene = sceneName.Substring(1); SceneManager.LoadScene("Loading"); } else { SceneManager.LoadScene(sceneName); } }, true); }
public void OnExit() { if (GameConductor.IsSleeping) { MusicBox.ChangeMusic(Song.Intro.ToInt()); ScreenFader.FadeOut(); NextState = new IntroState(GameConductor.GetDayCard()); GameConductor.IsSleeping = false; } else { NextState = new OblexState(); } }
void Dying() { StartCoroutine(ScreenFader.FadeOut()); animator.SetBool("isDrowning", false); animator.SetTrigger("Die"); Camera.main.GetComponent <CameraMovement>().target = null; GetComponent <CircleCollider2D>().enabled = false; isDead = true; rb.velocity = new Vector2(0f, dieFallSpeed); Camera.main.GetComponent <CameraMovement>().PlayBubblesSound(); FinishCanvasThing.SetActive(true); //GameObject.FindGameObjectWithTag("ScoreScreen").SetActive(true); StartCoroutine(CountScore.Activate(CollectableSystem.instance.score)); }
public IEnumerator FadeTransition(string direction) { if (direction == "In") { yield return(fader.FadeIn()); } else if (direction == "Out") { yield return(fader.FadeOut()); } else { throw new System.Exception("Error: " + direction + " is not a defined direction"); } }
// Corotina para sincronizar o fade in/out com o carregamento da cena public IEnumerator LoadScene(string scene) { if (GameObject.FindGameObjectWithTag("BGM") != null) { GameObject.FindGameObjectWithTag("BGM").GetComponent <BGMControl>().FadeOut(); } ScreenFader sf = GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>(); sf.FadeOut(fadeDuration); yield return(new WaitForSeconds(fadeDuration)); SceneManager.LoadScene(scene, LoadSceneMode.Single); sf.FadeIn(fadeDuration); isLoading = false; }
public void Play() { // Set all buttons to non-interactable so they can't be clicked during fade foreach (Button button in buttons) { button.interactable = false; } AudioManager.instance.PlayButtonClick(); AudioManager.instance.FadeOutMusic(); screenFader.FadeOut(delegate { SceneManager.LoadScene("TownScene"); }); }
private IEnumerator LoadRoomCO(int roomCode) { currentRoom = roomCode; Time.timeScale = 0; if (fader != null) { Time.timeScale = 0; yield return(fader.FadeOut()); Time.timeScale = 1; } SceneManager.LoadScene(scenes[roomCode]); yield return(OnRoomLoad()); }
public void interact() { if (switchesScene) { NextScene(); } else { sf.FadeIn(); coroutines.WaitThenExecuteAction(1f, () => { OnEnterNoSwitch.Invoke(); sf.FadeOut(); }); } }
private IEnumerator ToggleLoadingScreenRoutine(bool enable) { yield return(null); if (enable) { _loadingScreenGroup.gameObject.SetActive(true); yield return(ScreenFader.FadeIn(_loadingScreenGroup)); } else { yield return(ScreenFader.FadeOut(_loadingScreenGroup)); _loadingScreenGroup.gameObject.SetActive(false); } }
//Starts the game when start button is clicked public void sceneTransition(int x) { //Grabs screen fader object and component faderObject.SetActive(true); fade = faderObject.GetComponent <ScreenFader> (); /*//Music and SFX for the transition here * sfx.Stop(); * sfx2.clip = fadeOut; * sfx2.Play (); * music.Stop ();*/ //This causes the scene transition; see the //"ScreenFader" class for more info fade.FadeOut(x); }
IEnumerator OnTriggerEnter2D(Collider2D other) { if (inTransition == false) { other.GetComponent <PlayerMovement>().freeze = true; ScreenFader af = GameObject.FindWithTag("Fader").GetComponent <ScreenFader> (); yield return(StartCoroutine(af.FadeOut())); target.GetComponent <Warp>().inTransition = true; other.gameObject.transform.position = target.position; Camera.main.transform.position = target.position; yield return(StartCoroutine(af.FadeIn())); } }