[v0.2] Loading Screens


Hello all,  for this week I worked on a loading screen. 
Created 2 options and I will share here today some of tips how I did it :D

- Option 1

- Option 2

First of all I've created a specific prefab and a class to control this prefab, called UI_Loader. The manager responsible for the scene, that want to navigate to a new scene, will just need to initialize and launch the load and the prefab will do the rest, with this we can re-use this loading screen everywhere :D

The steps for it was:
1) Fade In the loading screen, using a IEnumerator to set alpha over time for the root UI component (in this case CanvasGroup, since I think it is easier to handle the alpha)
2) Together with the coroutine to fade in the layout, I started a coroutine to load the next scene async with SceneManager.LoadSceneAsync(levelName) and update the progress with the async load operation progress value, during update method from the UI_Load class.

Together with the loading, I created 2 types of loading: Fake, for when we need just a smooth transition between scenes for the player and a press any key to continue. 

To achieve this during the async load  I set the parameter allowSceneActivation of the async load operation to false, so when the load is complete, the SceneManager don't navigate to the loaded immediately. For the other 2 types, fake and press any key, I set the allowSceneActivation to true again if fakeDelay is finished or player hit any key.

Hope everyone like the post today, please give feedbacks about the loading screens (didn't decided yet which one will be the final) and see you all next week :D

Get KingsVsPirates

Leave a comment

Log in with itch.io to leave a comment.