Add Loading Screen in MFPS 2.0

Useful Tutorials.
Post Reply
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Some people have been asking me how to integrate my Loading Screen asset in MFPS, even though the procedure is the same as in any other project, I am going to publish the simple steps here:

1 - Import the Loading Screen package from the Asset Store into your MFPS Unity Project.


2 - Add and Setup all your game scenes in SceneLoaderManager (Check the Loading Screen documentation for more info)

3 - In the MainMenu scene Select and Drag one of the SceneLoaders prefabs into the Canvas object:
Image

4 - in bl_Lobby.cs -> IEnumerator MoveToGameScene() -> replace or comment this line:

Code: Select all

 bl_UtilityHelper.LoadLevel((string)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey]);
And add this:

Code: Select all

 bl_SceneLoaderUtils.GetLoader.LoadLevel((string)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey]);
Image

Since version 1.6 of MFPS, there's a new feature "Waiting Room", so if you are using that feature you also have to change this:

in bl_WaitingRoom.cs -> LoadMap() ->
Replace:

Code: Select all

 bl_UtilityHelper.LoadLevel((string)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey]);
with:

Code: Select all

bl_SceneLoaderUtils.GetLoader.LoadLevel((string)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey]);
That's :)
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
websbk
Contributor
Contributor
Posts: 180
Joined: Fri Aug 04, 2017 5:34 pm

Thanks
User avatar
kwsystems
Contributor
Contributor
Posts: 22
Joined: Sat May 02, 2020 11:43 am

Hi,

I have followed all the steps you mentioned but I cant show the loading as I want.

What I did:

1) Import assets
2) Drag 1 prefab to the main menu scence
3) Update the code

Am I missing something.

The version for MPS im using is 1.7
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

- Show me a screenshot of where you have dragged the loading screen prefab in the main menu scene.
- Does the scene load after you integrate the code?
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
KKHackLabs
Member
Member
Posts: 52
Joined: Thu May 07, 2020 3:34 pm

I followed the guide here, but I am still presented with the default loading screen.

Are there any settings that need to be changed for integration?
User avatar
Lovatto
Admin
Admin
Posts: 1834
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

Show me a screenshot of your hierarchy showing where the Loadding Screen prefab is located, please.
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
KKHackLabs
Member
Member
Posts: 52
Joined: Thu May 07, 2020 3:34 pm

Image

Error Message
Image
User avatar
setdevil
Contributor
Contributor
Posts: 77
Joined: Thu Jun 25, 2020 11:44 am

I have this error:
Assets\MFPS\Scripts\Network\Waiting Room\bl_WaitingRoom.cs(230,5): error CS0106: The modifier 'public' is not valid for this item
After i have replace with this: bl_SceneLoaderUtils.GetLoader.LoadLevel((string)PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey]);
at line 181 in bl_WaitingRoom.cs

Anyone can help me?
Post Reply