PUN-Download the local server and run the Demo test (2)

1. Download the local server


insert image description here
After https://www.photonengine.com/en-US/sdks#server-sdkserverserverplugin is downloaded, it is a compressed package. After decompression, the directory is as follows:
insert image description here

Two, start the server

Start deploy/bin_Win64/PhotonControl.exe and
insert image description hereyou will see a gray Logo under the task bar, which is the local server software.
insert image description here
Right-click the application, click LoadBalancing (MyCloud)/Start as application
insert image description here
to start, and the server status changes to the startup status
insert image description here

3. Add PUN plugin from AssetStore

https://assetstore.unity.com/
Search for PUN, add it to your own resources
insert image description here

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.
insert image description here
Select Window/Package Manager
insert image description here
insert image description here
to download and import it
insert image description here
here. You need to fill in the AppID we mentioned in the previous section, copy it directly and click Setup Project. As
insert image description here
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
insert image description here

5. Run the built-in Demo

We enter the Demo shown in the figure below and start the experience directly.
insert image description here
Add the scene to BuildSetting and
insert image description here
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.

insert image description here

Guess you like

Origin blog.csdn.net/weixin_38484443/article/details/125695403