public void ReloadCurrentSceneAsynchronously() { int index = SceneManager.GetActiveScene().buildIndex; if (index != -1) { Time.timeScale = 1f; Time.fixedDeltaTime = 0.02f; int asyncSceneIndex = SceneUtility.GetBuildIndexByScenePath(ASYNCLOADER_SCENE_NAME); AsyncLoadIndexSaver.SetIndexToPreload(index); StartCoroutine(SharedUtilities.GetInstance().StartSceneWithDelay(0, asyncSceneIndex)); SceneChanged?.Invoke(SceneManager.GetActiveScene().name); } }
private void Start() { indexToPreload = AsyncLoadIndexSaver.GetSceneIndexToPreload(); StartCoroutine(LoadSceneAsync()); }