// Use this for initialization void Start() { buttonManagerScript.enterCutscene(); _rectTransform = commentaryDialogueBox.GetComponent <RectTransform> (); _backgroundVolume = PlayerPrefs.GetFloat("BGSlider"); _masterVolume = PlayerPrefs.GetFloat("MSTRSlider"); if (_masterVolume > _backgroundVolume) { _volume = _backgroundVolume; } else { _volume = _masterVolume; } backgroundAudioSource.volume = 0; if (skipIntro == true) { blackScreen.color = Color.clear; text.color = Color.clear; buttonManagerScript.exitCutscene(); } else { StartCoroutine(TutorialIntro()); } }
IEnumerator NonTutorialIntro() { Time.timeScale = 0; float startTime = Time.unscaledTime; float fade; yield return(new WaitForSecondsRealtime(1f)); _color = new Color(1, 1, 1, 1); while (blackScreen.color.a >= 0) { _color = new Color(blackScreen.color.r, blackScreen.color.g, blackScreen.color.b, blackScreen.color.a - Time.unscaledDeltaTime * colorFadeSpeed); blackScreen.color = _color; yield return(new WaitForSecondsRealtime(0.01f)); } buttonManagerScript.exitCutscene(); Time.timeScale = 1; }