- Home /
how to preload assets with progress bar
I know about preloaded assets in play settings. But I want it with progress bar.
The problem is I dont have a option to show a progress bar while assets are loading. I want to make a loading scene which will be the first scene of the game. And in that scene I will load all assests which will be needed all the time & while loading those assets need to show a loading bar with progress.
Anybody have a solution for this?
Answer by x4637x · Aug 08, 2017 at 08:48 AM
Why don't you preloaded your assets at your first scene like you said then? Run something like the following in your first scene and display the progress number to whatever you like :
//The 32 doesn't matter in this case
AssetBundleCreateRequest newRequest = AssetBundle.LoadFromFileAsync("path",32);
newRequest.progress; //progress between 1 to 0
Yes I am using "Preloaded Assets" in PlayerSettings. And everything working cool. But was not able to show progress bar. And I'm not using AssetBundle, I have all my textures in Resource folder
The "Preloaded Assets" is not for what you want to do, it will always make sure those assets is ready from the second game starts, which means even before your first scene is loaded.
As for AssetBundle or not, it doesn't matter what you use, as long as you use something end with "Async", you will likely have this progress variable available for your progress bar display. $$anonymous$$ore specifically in this case :
ResourceRequest newRequest = Resources.LoadAsync("path");
newRequest.progress;
Your answer
Follow this Question
Related Questions
Unity stuck on loading at "Apply active color space" 1 Answer
Loading Screen - FLASH export 2 Answers
pre-load multiple scenes but only activate one 0 Answers
loading prefabs 1 Answer