private IEnumerator FadeIn(string sceneName) { // fade in black texture { float time = 0; while (time <= _fadeInterval) { _alpha = Mathf.Lerp(0f, 1f, time / _fadeInterval); time += Time.unscaledDeltaTime; yield return(null); } _alpha = 1.0f; } // scene change { // reset time scale { Time.timeScale = 1.0f; } _fadeState = FadeUtility.FadeState.FadeinFinish; // load next scene SceneUtility.LoadScene(this, sceneName, () => { // 通知 _notifyChangeScene(sceneName); // フェードアウト開始 _fadeState = FadeUtility.FadeState.FadeoutStart; StartCoroutine(FadeOut()); }); } }
private void Start() { SceneUtility.InitializeDummyCamera(_dummyCamera); }
public string GetCurrentSceneName() { return(SceneUtility.GetCurrentSceneName()); }
/// <summary> /// 即時シーン切り替え フェード無し /// </summary> /// <param name="sceneName"></param> public void TransitionSceneImmediate(string sceneName) { SceneUtility.LoadScene(this, sceneName); }