예제 #1
0
    public void Load(int levelIndex, float fadeTime = 3.0f)
    {
        if (_loading)
        {
            return;
        }

#if DEBUG
        Debug.Log("Loading level: " + _currentLevelIndex);
#endif
        _currentLevelIndex = levelIndex;

        _loading = true;
        LevelLoader.Load(levelIndex);
        var fader = CameraUtil.GetFader();
        StartCoroutine(fader.FadeToBlack(fadeTime, () => {
            StartCoroutine(TrySwitch(fader));
            _loading = false;
        }));
    }
예제 #2
0
 private void End()
 {
     StartCoroutine(CameraUtil.GetFader().FadeToBlack(10f, () => { Application.Quit(); }));
 }