Setting up UniStorm with Photon PUN 2 - Black-Horizon-Studios/UniStorm-Weather-System GitHub Wiki

Setting up UniStorm with Photon PUN 2

UniStorm version 4.2.1 brings included integration with PUN 2. This works by having each player have their own UniStorm system that is run locally. The host syncs its weather, time, and date with all connected clients. If the host is disconnected, a new one is picked and the syncing process continues. Also, since each weather system is handled locally, each player can have their own quality settings. So for example, Player 1 can run UniStorm on Volumetric Ultra, where Player 2 uses Volumetric Low, and Player 3 uses 2D Medium.

A demo scene is included that shows a working example of this.

Step 1

First, you will need to make sure you have Photon PUN 2 imported into your projects.

Step 2

Make sure you have gone through the setup process of PUN 2 and its setup wizard so you can properly connect using their included network examples.

Step 3

Import the included UniStorm PUN 2 Integration UnityPackage file located under UniStorm>Network Integration>UnityPackages>UniStorm PUN 2 Integration. Double click to begin the import process.

Step 4

Once the UniStorm PUN 2 Integration UnityPackage has been imported, open the UniStorm Network PUN 2 Example scene located under UniStorm>Network Integration>UniStorm PUN 2 Integration>Scene.

Step 5

Test the scene out to ensure everything is working correctly. "Connecting to Server" should be displayed for a few seconds before a player is created along with a UniStorm Prefab. By default, the UniStorm Menu is enabled to control UniStorm's time of day and weather. This option will only work for the host player. To disable this feature, go to Camera & Player Settings tab within the UniStorm Network System prefab.

Step 6

Refer to the setup within this scene for integrating UniStorm with custom character controllers and scenes. In order for everything to work correctly, a UniStormNetworkSync script is required to be on all players. A "Lobby" camera name is also needed so there's always at least 1 camera in the scene. However, this can be modified as needed. The UniStorm Photon Manager is responsible for spawning the UniStorm Network Player prefab. If you wish to spawn your own player, your player prefab must be located in a Resources folder.

Note: The Get Player at Runtime and Use Runtime Delay must be enabled in order for UniStorm to delay its initialization process until the player is spawned. Ensure that the proper camera and player tags, or player name and camera name, are used.