Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: TommyA on November 27, 2012, 11:57:00 PM
-
Hi
How should I make loading screen between scenes with playmaker?
I need loading screen which has loading progress bar related with loading status.
I have NGUI so if possible, I want to make this with NGUI.
I searched help thread but not found any related with this.
Please help me.
Thank you.
-
Hello,
I am trying to do the same but I am not able to find usefull informations (i don't use NGUI). TommyA you managed somehow to do it?
Someone has a suggestion on how to set a variable with the loaded% of level size?
Thank you
Luca
-
Hello!
As far as I can tell, this might take a little bit of programming for you to do in PlayMaker. If you're not a C# programmer, then consider suggesting this functionality to hutong games.
I'm looking at the Load Level action from the LoadLevel.cs file. This action has a bool "Async" which allows the level to load in the background.
Inside the LoadLevel.cs file, there is a private variable named "asyncOperation" which contains the progress of the level loading.
http://docs.unity3d.com/Documentation/ScriptReference/AsyncOperation.html
You would have to make a custom event and add a public FsmFloat to expose the loading progress, which you can then use to set a progress bar.
- Garth Smith
-
Thank you Garth! you're right i see the read only variable.
I am not so skilled atm with programming and this sounds like a work for jeanfabre, hopefully he will see this topic ;)
Thanks
Luca
-
Hi,
ok :) Can you test the actions I pasted below? I admit I haven't been able to find the time to test them properly, So I would appreciate, if they work, then I'll put it in the proper section onm the forum.
Basically, I chose to have them as seperate from LoadLevel because it will work for any situation if you implement it manually, within LoadLEvel it would get difficlt to satisfy both asynch and synch loading ( with the "loaded event" issue).
bye
Jean
-
Hey Jean,
Tried both actions on iOS/PC/mac and can not get them to work :S
-
Hello Jean,
thank you very much! I am trying the actions but I think something is wrong in my usage: I got 0 for unloaded and 1 for loaded.
Tomorrow I'll try the actions with heavy scenes in the game we are working on, and I'll let you know if the value can pass from 0.00 to 1.00. In fact I think the loading time is the answer.
Thank you
Luca
-
So were you able to get a float from 0-1, mine sat at 0 while loading and then it must have hit 1 as the level loaded (wasn't using additive)
-
Hi,
yes, that's the thing, you need a proper heavy scene to testify it. I'll see if I have time to validate this properly. I'll keep you updated.
bye,
Jean
-
Hi,
just tried with a heavy level but doesn't work. The float become 1 directly from 0 and then the scene takes 5 seconds to load.
-
http://forum.unity3d.com/threads/22366-Application-GetStreamProgressForLevel-for-iPhone
"Application.LoadLevel and Application.LoadLevelAdditive are blocking operations. Thus Application.GetStreamProgressForLevel will return only 0 or 100."
http://answers.unity3d.com/questions/230611/applicationgetstreamprogressforlevel-ios-not-worki.html
" I'm pretty sure Asynchronous progress reporting in this regards has never worked in any version of Unity Free or Unity Pro."
Unity docs says "In the webplayer this returns the progress of this level." so assuming you're building to iOS or Android lucaderiu, it looks like this may not work :(
-
Thanks LampRabbit,
yes we are working for iOS and looks like we'll have to put a fake progress bar :)
-
Hello!
In my experience making progress bars, the progress bar does not work in the following cases:
- Unity Free: Async loading does not work on Unity Free.
- Unity Editor: Async loading does not show progress in the Unity Editor. However, when building to my iOS device I see the progress bar.
- Small or empty scenes: Like many progress bars, the progress bar tends to load in chunks. On small or empty scenes, the scene will load from 0 to 100 in a single chunk, thus showing 0% progress then 100% progress.
- Garth Smith
-
Also, I don't think Application.GetStreamProgressForLevel is the correct way to get level loading progress. The correct way is to save a reference to the AsyncOperation returned by Application.LoadLevelAsync, then check the progress every frame.
Example:
private AsyncOperation checkThisForProgress = null;
void Start() {
checkThisForProgress = Application.LoadLevelAsync(1);
}
void Update() {
if (checkThisForProgress != null) {
Debug.Log("Progress: " + checkThisForProgress.progress);
}
}
EDIT: I've never used Application.GetStreamProgressForLevel before, so don't believe anything I say when it comes to that command.