Просмотр исходного кода

autoHideLoadingUI in assetManager

sebavan 6 лет назад
Родитель
Сommit
9a491cbe48
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      src/Misc/assetsManager.ts

+ 10 - 1
src/Misc/assetsManager.ts

@@ -820,6 +820,13 @@ export class AssetsManager {
     public useDefaultLoadingScreen = true;
     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
      * Creates a new AssetsManager
      * @param scene defines the scene to work on
      * @param scene defines the scene to work on
      */
      */
@@ -1010,7 +1017,9 @@ export class AssetsManager {
                 console.log(e);
                 console.log(e);
             }
             }
             this._isLoading = false;
             this._isLoading = false;
-            this._scene.getEngine().hideLoadingUI();
+            if (this.autoHideLoadingUI) {
+                this._scene.getEngine().hideLoadingUI();
+            }
         }
         }
     }
     }