public SceneData(string name) { Menu = UIConsts.FORM_ID.NONE; Name = name; Forms = new List <FormData>(); PreloadSceneName = UIConsts.SCENE_ID.NONE; DesignResolutionWidth = 0; DesignResolutionHeight = 0; DesignMatchWidthOrHeight = 1; // by default match height }
private IEnumerator PreloadSceneAsync(UIConsts.SCENE_ID sceneToPreload) { //AsyncOperation asyncOperation = Application.LoadLevelAsync(UIConsts.SCENE_NAMES[(int)sceneToPreload]); AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(UIConsts.SCENE_NAMES[(int)sceneToPreload]); asyncOperation.allowSceneActivation = false; _scenePreloadersOperations.Add(sceneToPreload, asyncOperation); yield return(asyncOperation); //Debug.Log("Preload done ____________________________"); }
private IEnumerator PreloadSceneAsync(UIConsts.SCENE_ID sceneToPreload) { AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(UIConsts.SCENE_NAMES [(int)sceneToPreload]); asyncOperation.allowSceneActivation = false; EventData eventData = new EventData("OnAsyncSceneLoadEvent"); eventData.Data.Add("asyncOperation", asyncOperation); GameManager.Instance.EventManager.CallOnAsyncSceneLoadEvent(eventData); _scenePreloadersOperations.Add(sceneToPreload, asyncOperation); yield return(asyncOperation); //Debug.Log ("Preload done ____________________________"); }
public void TransitToScene(UIConsts.SCENE_ID nextScene) { if (_currentScene != UIConsts.SCENE_ID.SPLASHSCENE) { var fader = new FadeTransition() { fadeToColor = Color.black }; TransitionKit.instance.transitionWithDelegate(fader); } GameManager.Instance.StartCoroutine(PreloadSceneAsync(nextScene)); LeanTween.delayedCall(0.5f, () => TransitToSceneDelayed(nextScene)); }
private void TransitToSceneDelayed(UIConsts.SCENE_ID nextScene) { _currentScene = nextScene; AsyncOperation preloadAsyncOperation; if (_scenePreloadersOperations.TryGetValue(nextScene, out preloadAsyncOperation)) { preloadAsyncOperation.allowSceneActivation = true; _scenePreloadersOperations.Remove(nextScene); } else { _scenePreloadersOperations.Clear(); //Debug.Log ("GameFlow: transiting to scene <" + nextScene + ">"); SceneManager.LoadScene(UIConsts.SCENE_NAMES [(int)nextScene]); } }
public void TransitToScene(UIConsts.SCENE_ID nextScene) { if (nextScene == UIConsts.SCENE_ID.MAINMENU || nextScene == UIConsts.SCENE_ID.SPLASH_SCENE) { FadeTransition.ExtraDelay = 0.7f; } else { FadeTransition.ExtraDelay = 0.1f; } if (_currentScene != UIConsts.SCENE_ID.STARTSCENE) { var fader = new FadeTransition() { fadeToColor = Color.black }; TransitionKit.instance.transitionWithDelegate(fader); } LeanTween.delayedCall(0.5f, () => TransitToSceneDelayed(nextScene)); }
public SceneData(string name) { Menu = ""; Name = name; PreloadSceneName = UIConsts.SCENE_ID.NONE; }