Пример #1
0
    IEnumerator LoadLvl(GameStateBehaviour game)
    {
        if (combatSceneLoad == null)
        {
            combatSceneLoad = SceneManager.LoadSceneAsync(2);
        }
        combatSceneLoad.allowSceneActivation = false;

        while (!combatSceneLoad.isDone)
        {
            game.SetSlider(combatSceneLoad.progress * 100);
            if (combatSceneLoad.progress >= .9f)
            {
                game.SetSlider(100);
                game.SetText("Press Any Key to Start");
                if (Input.GetKeyDown(KeyCode.E))
                {
                    ToState(game, Next);
                }
            }
            yield return(null);
        }

        PlayerData.Instance.ForceRefresh();
        yield return(null);
    }