Przeglądaj źródła

autoHideLoadingUI in assetManager

sebavan 6 lat temu
rodzic
commit
9a491cbe48
1 zmienionych plików z 10 dodań i 1 usunięć
  1. 10 1
      src/Misc/assetsManager.ts

+ 10 - 1
src/Misc/assetsManager.ts

@@ -820,6 +820,13 @@ export class AssetsManager {
     public useDefaultLoadingScreen = true;
 
     /**
+     * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen
+     * when all assets have been downloaded.
+     * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.
+     */
+    public autoHideLoadingUI = true;
+
+    /**
      * Creates a new AssetsManager
      * @param scene defines the scene to work on
      */
@@ -1010,7 +1017,9 @@ export class AssetsManager {
                 console.log(e);
             }
             this._isLoading = false;
-            this._scene.getEngine().hideLoadingUI();
+            if (this.autoHideLoadingUI) {
+                this._scene.getEngine().hideLoadingUI();
+            }
         }
     }