void Update() { if (Input.GetKeyDown(KeyCode.Space)) { DisplayNextSentence(); } else if (Input.GetKey("escape")) { Application.Quit(); } if (scene.name == "Beginning_Scene" && narrator.hasFinished && !audioData.isPlaying) { StartCoroutine(ChangeSceneAfterSound("Bus_Scene")); } else if (scene.name == "Bus_Scene" && player.hasFinished && !audioData.isPlaying) { fadeController.FadeIn(1); StartCoroutine(ChangeSceneAfterSound("House_Overview")); } else if (scene.name == "House_Overview" && player.hasFinished && !audioData.isPlaying) { fadeController.FadeIn(1); StartCoroutine(ChangeSceneAfterSound("Scratch_Game")); } else if (scene.name == "End_Scene" && player.hasFinished) { fadeController.FadeIn(1); title.enabled = true; authors.enabled = true; StartCoroutine(FinishGameAfterDuration(5)); } }
public void GoMainMenu(int _sceneIndex = 0) { //Audio down audioMng.FadeAll(0); audioMng.Clear(); fadeCtrl.FadeIn(() => { SceneManager.LoadScene(_sceneIndex); }); }
IEnumerator WaitToReset() { isWait = true; _AudioController.ChangeMusic(_AudioController.level1); _FadeController.FadeIn(); yield return(new WaitForSeconds(1f)); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }
public void StartIdle() { ClearIdleTimer(); RemoveListeners(); idleEnabled = true; environmentCameraController.movementFinished.AddListener(OnMovementFinished); fadeController.fadedIn.AddListener(OnStartFidedIn); fadeController.FadeIn(); idleStarted?.Invoke(); }
private IEnumerator HandleGameOverState() { if (gameOver) { yield break; } gameOver = true; yield return(fadeController.FadeIn(5f)); obstacleManager.StopSpawning(); player.SetActive(false); hand.SetActive(false); yield return(new WaitForSeconds(1)); player.SetActive(true); hand.SetActive(true); yield return(fadeController.FadeOut(50f)); obstacleManager.StartSpawning(); gameOver = false; }
public IEnumerator PopulateNewLevel() { if (isFever) { isFever = false; feverLight.SetActive(false); feverBG.SetTrigger("FeverOff"); SoundManager.instance.PlayBGM(bgm); FindObjectOfType <BulletManager>().ChangeBulletType(BulletManager.BulletType.Default); StopCoroutine(feverRoutine); } hostageObject.SetActive(false); level.text = currentLevel.ToString(); minionNum.transform.parent.gameObject.SetActive(false); yield return(PlanetPivot.instance.StartCoroutine(PlanetPivot.instance.RotatePlanet())); alertAnim.GetComponent <Animator>().SetTrigger("Alert"); SoundManager.instance.PlaySFX(chicken); yield return(new WaitForSeconds(2f)); yield return(FadeController.FadeIn(ufo.GetComponent <SpriteRenderer>())); SoundManager.instance.PlaySFX(alien); PopulateLevelInfo(); minionNum.transform.parent.gameObject.SetActive(true); }
IEnumerator Respawn(int m_index, bool val) { float t = 0.5f; if (val) { yield return(StartCoroutine(fade.FadeOut())); } yield return(new WaitForSeconds(.5f)); while (t > 0) { yield return(null); t -= Time.deltaTime; bicycle.transform.position = spawnSystem.GetChild(m_index).position + (-Vector3.up * distanceSpawn); bicycle.transform.eulerAngles = new Vector3(0f, spawnSystem.GetChild(m_index).eulerAngles.y, 0f); bicycle.GetComponent <Rigidbody>().velocity = Vector3.zero; bicycle.BrakeExtreme(); } if (val) { StartCoroutine(fade.FadeIn()); } oneCall = true; }
void GoToDemoUI() { fadeScreen.FadeIn(0.1f, () => { SceneManager.LoadSceneAsync(1); }); }
private void Start() { m_fadeController = FadeController.Instance; m_fadeController.SetSortingOrder(1); m_fadeController.FadeIn(1.0f, Color.black); FadeController.Instance.FadeIn(1.0f); }
private IEnumerator DoTransition(SceneTransitionZone sceneTransition) { zoomSound.Play(); yield return(fadeController.FadeOut(Color.black, fadeDuration)); gameObject.transform.position = sceneTransition.target.spawnPoint; yield return(fadeController.FadeIn(fadeDuration)); }
IEnumerator Activate() { m_fader.FadeIn(2.0f, () => { UnityEngine.Debug.Log("Fade In"); async.allowSceneActivation = true; }); yield return(null); }
public IEnumerator ScreenFade(float fadeOutTime, float fadeInTime, Color screenColor) { yield return(fadeController.FadeOut(screenColor, fadeOutTime)); yield return(new WaitForSeconds(0.5f)); yield return(fadeController.FadeIn(fadeInTime)); }
public IEnumerator StartGame() { canvas.enabled = false; yield return(fadeController.FadeOut(Color.black, fadeDuration)); SwitchToPlayer(); yield return(fadeController.FadeIn(fadeDuration)); }
// Update is called once per frame public void OnStartButton(string scene) { clicked = true; Time.timeScale = 1.0f; fader.FadeIn(1.0f, () => { SceneManager.LoadScene(scene); }); }
private void Start() { cf = canvasFinish; cf.SetActive(false); isPlay = false; counter.gameObject.SetActive(false); title.gameObject.SetActive(false); StartCoroutine(fadeController.FadeIn()); }
IEnumerator Activate() { fader.FadeIn(3f); yield return(new WaitForSeconds(3f)); fader.FadeOut(2f, () => { UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("1_StartScene"); }); }
IEnumerator LoadSceneCR(int sceneIndex, float fadeOutTime, float fadeInTime) { FadeController.FadeOut(fadeOutTime); yield return(new WaitForSeconds(fadeOutTime)); SceneManager.LoadScene(sceneIndex); FadeController.FadeIn(fadeInTime); instance.changingScenes = false; }
IEnumerator Activate() { yield return(null); fader.FadeIn(1f, () => { UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("3_GameScene"); Fade.SetActive(false); }); }
void Start() { _highlight = transform.Find("Highlight").gameObject; _gameController = GameObject.Find("GameController").GetComponent <GameController>(); _fadeController = transform.parent.parent.Find("black_screen").GetComponent <FadeController>(); StartCoroutine(_fadeController.FadeIn(0.35f)); }
void NextDialogo() { isFirstNext = true; idFala = 0; idDialogo++; if (idDialogo >= dialogo.Length) //ultima cena { isLastScene = true; canvasText.SetActive(false); _FadeController.FadeIn(); StartCoroutine("WaitFadeOut"); } else { _FadeController.FadeIn(); StartCoroutine("WaitFadeOut"); UpdateFalasList(); } }
IEnumerator WaitFadeIn() { _FadeController.FadeIn(); yield return(new WaitForSeconds(timeToFadeOut * 2)); if (_FadeController.isFadeComplete == true) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } }
// Start is called before the first frame update void Start() { fader.FadeIn(); drawTime = defaultTime; for (int i = 0; i < rankScore.Length; i++) { //順位事の付加ポイントを格納しとく rankScore[i] = 100 - (25 * i); } }
private void Update() { if (Input.anyKeyDown) { m_isIn = !m_isIn; if (m_isIn) { m_fadeController.FadeIn(m_fadeInTime, m_fadeInColor); } else { m_fadeController.FadeOut(m_fadeOutTime, m_fadeOutColor); } } }
private void Start() { m_fc = FindObjectOfType <FadeController>(); m_am = FindObjectOfType <AudioManager>(); if (m_fc) { Debug.Log($"GameManager::{m_fc.GetType().ToString()}"); } PlayerIsFound = false; m_fc.FadeIn(m_waitoToStartFadeIn); }
void Start() { screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z)); audioData = GetComponent <AudioSource>(); fadeController = GetComponent <FadeController>(); //ensure game start with fade black fadeController.FadeIn(0); fadeController.FadeOut(2); StartCoroutine(ItchSpawner()); }
private void Start() { m_fadeController = FadeController.Instance; m_fadeController.SetSortingOrder(0); m_fadeController.FadeIn(1.0f, Color.black); if (TextObj != null) { TextObj.SetActive(false); } }
IEnumerator GameOverEvent_() { _musicPlayer.PlayPlayerDeath(); yield return(StartCoroutine(_uiController.ShowGameOver())); yield return(new WaitForSeconds(3f)); yield return(StartCoroutine(_blackScreenFadeController.FadeIn(1))); yield return(new WaitForSeconds(1f)); GameObject.Find("LevelManager").GetComponent <Level> ().LoadStartMenu(); }
private void Start() { m_fc = FindObjectOfType <FadeController>(); m_ac = FindObjectOfType <AudioController>(); m_audioSource = GetComponent <AudioSource>(); if (m_loadSceneName != null) { Debug.Log($"{m_loadSceneName}をロードする準備ができました"); } else { Debug.LogError("シーンを設定してください"); } m_fc.FadeIn(m_waitTimeToFadeIn); }
private IEnumerator LoadLevel(int levelId, bool resetHp = false) { yield return(StartCoroutine(_fadeController.FadeIn())); SceneManager.LoadScene(levelId, LoadSceneMode.Single); foreach (GameObject g in _playerObjects) { g.SetActive(true); } if (resetHp) { _scriptablePlayer._lifes = 3; } yield return(StartCoroutine(_fadeController.FadeOut())); }
IEnumerator FadeInScene() { yield return(StartCoroutine(FadeController.FadeIn(reviveScene))); scoreObject.gameObject.GetComponent <RectTransform>().DOLocalMoveX(1080 / 2, 1, true); //scoreObject.gameObject.transform.DOMoveX(0, 1f, true); yield return(new WaitForSeconds(1f)); finalScore.GetComponent <CanvasGroup>().DOFade(1, 0.5f); yield return(new WaitForSeconds(0.5f)); bestScore.GetComponent <CanvasGroup>().DOFade(1, 0.5f); yield return(new WaitForSeconds(0.5f)); todayBest.GetComponent <CanvasGroup>().DOFade(1, 0.5f); yield return(new WaitForSeconds(0.5f)); StartCoroutine(FadeController.FadeIn(adsObject)); }