1. Download the local server
After https://www.photonengine.com/en-US/sdks#server-sdkserverserverplugin is downloaded, it is a compressed package. After decompression, the directory is as follows:
Two, start the server
Start deploy/bin_Win64/PhotonControl.exe and
you will see a gray Logo under the task bar, which is the local server software.
Right-click the application, click LoadBalancing (MyCloud)/Start as application
to start, and the server status changes to the startup status
3. Add PUN plugin from AssetStore
https://assetstore.unity.com/
Search for PUN, add it to your own resources
4. Create a new Unity project and import the PUN package
I am using the 2020.3.26f1c1 version. You can also use other versions. The project is named PUNTest.
Select Window/Package Manager
to download and import it
here. You need to fill in the AppID we mentioned in the previous section, copy it directly and click Setup Project. As
shown in the figure, a PhotonServerSettings configuration file will be automatically generated. This configuration is some basic configuration we need to use later. The specific configuration modification and parameters will be explained in the next chapter. This chapter directly uses the default configuration and directly connects to the cloud server to run demo
5. Run the built-in Demo
We enter the Demo shown in the figure below and start the experience directly.
Add the scene to BuildSetting and
run it. You can see that after clicking Login, the network configuration will be initialized. You can create a room, enter a room randomly, and view the room list. If If multiple people enter, it will become a multiplayer online mode.