Exemple #1
0
 /// <summary>
 /// Adds the listener for loading finished.
 /// </summary>
 /// <remarks>
 /// Ensures that the object will be reactivated if without a loading system active,
 /// for example when playing the level in the editor out of sequence.
 /// </remarks>
 private void Awake()
 {
     if (LoadingTransitionController.Exists())
     {
         gameObject.SetActive(false);
     }
     LoadingTransitionController.OnLoadingFinished += ActivateGameObject;
 }
Exemple #2
0
 /// <summary>
 /// Handles if there is no transition controller.
 /// </summary>
 private void Start()
 {
     if (!LoadingTransitionController.Exists())
     {
         // no transition controller so disable updating.
         enabled = false;
     }
 }
Exemple #3
0
 /// <summary>
 /// Loads the scenes set on the object.
 /// </summary>
 public void LoadScene()
 {
     if (useLoadingScene)
     {
         LoadingTransitionController.AnimatedLoadSceneAsync(nextScene, loadingScene, overrideMinTransitionDuration);
     }
     else
     {
         LoadingTransitionController.AnimatedLoadSceneAsync(nextScene, overrideMinTransitionDuration);
     }
 }
Exemple #4
0
 /// <summary>
 /// Updates the loading display text.
 /// </summary>
 private void Update()
 {
     text.text = "Loading... " + LoadingTransitionController.Progress().ToString("P0");
 }