Pre-Built Example Scenes

I have included example scenes for inventory and no inventory characters alike. These scenes take the invector demo scenes and convert them to support multiplayer. You don't need to convert anything in these scenes as all of the work is done for you.

If done correctly you could have a ready to play example multiplayer project setup within 15 minutes.

Main Scenes

There is the concept of the Main scene. The Main scene is any scene that is at index 0 and is never un-loaded. This scene should hold your UI elements and your NetworkManager component. The Network Manager component is the brains of the operation. In this project I have the EMI_NetworkManager component pre-built for you with some complex logic wrapped in a nice to use set of functions. Read all about that in the Network Manager documentation included in this set of documentation.

Main scenes are available at:

Assets/CBGames/EasyMultiplayer-Invector/Basic Locomotion/Scenes/MAIN_BasicLocomotion.unity
Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/MAIN_MeleeCombat_Inventory.unity
Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/MAIN_MeleeCombat_NoInventory.unity
Assets/CBGames/EasyMultiplayer-Invector/Shooter/Scenes/MAIN_Shooter_NoInventory.unity
Assets/CBGames/EasyMultiplayer-Invector/Shooter/Scenes/MAIN_ShooterMelee.unity

So for example if you are using Invector - Melee Combat in your project with a character that has inventory place:

Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/MAIN_MeleeCombat_Inventory.unity

at index 0 of your Build Settings in your project.

If you're using Invector - Basic Locomotion, there is no concept of inventory so there is only one main scene to use:

Assets/CBGames/EasyMultiplayer-Invector/Basic Locomotion/Scenes/MAIN_BasicLocomotion.unity

This same logic will apply if you use Invector - Shooter.

Example Scenes

Now that you have selected an appropriate MAIN scene and put it into your project select the corresponding example scene and place it at index 1 of your build settings.

The following is a list of example scenes:

Assets/CBGames/EasyMultiplayer-Invector/Basic Locomotion/Scenes/Example_Scenes/MP_BasicLocomotion.unity
Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/Example Scenes/MP_Invector_MeleeCombat.unity
Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/Example Scenes/MP_Invector_MeleeCombat_NoInventory.unity
Assets/CBGames/EasyMultiplayer-Invector/Shooter/Scenes/ExampleScenes/MP_Invector_ShooterMelee.unity
Assets/CBGames/EasyMultiplayer-Invector/Shooter/Scenes/ExampleScenes/MP_Invector_ShooterMelee_NOInventory.unity

So for example if you have selected:

Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/MAIN_MeleeCombat_Inventory.unity

to be your MAIN scene. Then you would want to select:

Assets/CBGames/EasyMultiplayer-Invector/Melee Combat/Scenes/Example Scenes/MP_Invector_MeleeCombat.unity

To be your example scene.

Final Notes

Remember these are just example scenes. Once you have built a server and client to play around with this be sure to remove them from your build settings to not include them in your final build.

The MAIN scenes are nice because they already contain all the components pre-setup for you. It could prove advantagious to copy the MAIN scene to your project folder and modify the copy to keep the original. That way if you experience any issues you can quickly review how the original was setup.