- Home /
The question is answered, right answer was accepted
Inter Scene Loading Screen Animation
Hi, I have implemented a Loading screen animation using GUITextures. I load the next level using Async Loader and check in onGUI that if asyncLoader.isdone is true. The problem is It animates well but then it found isdone = true while scene is not switched completely and screen freezes for just those moments.
Is there a way to overcome this. Can i know when the Actual Scene transition has finished ?
I think showing an animation in a separate thread that persist for both scene might be the solution but i just don't know how to implement such a thread that can be started parallel when next scene started loading and finish it when the loading is "Actual Finished".
Can Anyone Help ?
Regards,
Answer by orochi663 · Oct 15, 2013 at 08:33 AM
Well, I found the solution: Use LoadLevelAsync using Async Operation, but there will always be a switching delay.
Answer by DaveA · Mar 26, 2012 at 11:28 PM
You could have a Start script in the newly-loaded level signal that fact.
Yes for the time being i am doing it. But this is not actual solution as animation do hang up just before second scene render started. I even signaled animation after 10 frames of next loading level but the halt is quite noticeable. and in this case it halts just before loading continues for 10 more frames. I just want to get rid of halting :S
Still no solution to the hang while scene switching issue :(
Answer by IndieScapeGames · Mar 27, 2012 at 12:06 AM
Here's a bit of code that might do what you want:
void Start() {
Application.LoadLevel (levelToChange);
}
Now, this is in C#, so you will have to create your own script, but this should help. There are numerous things you can do during this load screen if you want, just include a few method calls.
For example say we want some background music to play, just create another method that will play the audio you wish.
void exampleMusic() {
audio.Play();
}
This is the method you want, you'll need to create an audio source or something similar, and either have a private variable for an audio clip, or a public, so that way each level loading screen will have unique music.