-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VR demo #751
base: main
Are you sure you want to change the base?
Add VR demo #751
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||||
# Unity Multiplayer VR Sample | ||||||||
|
||||||||
his sample show off how to use [Azure Realtime Transport for Unity](https://github.com/wanlwanl/multiplayer-community-contributions/tree/wanl/transport/Transports/com.community.netcode.transport.azure-realtime) in VR game. | ||||||||
|
||||||||
> This project is based on Meta Oculus's [Unity-UltimateGloveBall](https://github.com/oculus-samples/Unity-UltimateGloveBall) sample, please try to setup and run it first. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stick to one commit incase some breaking change happens to the referenced repo? |
||||||||
|
||||||||
## Additional Setup | ||||||||
|
||||||||
### A. Setup Dev Negotiate Server | ||||||||
|
||||||||
1. Copy connection string in `Keys` page of your Web PubSub service you just created. | ||||||||
2. Install [dotnet runtime](https://learn.microsoft.com/dotnet/core/install/) if you don't have one. | ||||||||
3. In `Proejct` view, right click `Packages/Azure Web PubSub Transport for Netcode for Gameobjects`, and click `Show in Explorer`. | ||||||||
4. Extact `Resources/NegotiateServersSource~.zip` and go into the extracted folder `NegotiateServersSource~/AWPSNegotiateServer`, rename `appsettings.sample.json` to `appsettings.json `, fill the connection string in `ConnectionString` section. | ||||||||
5. In terminal app, run `dotnet run` to start negotiation server. | ||||||||
6. Get listening URL in console log. For example: `Now listening on: https://localhost:7172` | ||||||||
|
||||||||
### B. Setup Transport | ||||||||
|
||||||||
1. Download latest `azure-webpubsub-transport.unitypackage`package from `[Releases](https://github.com/albertxavier100/azure-web-pubsub-transport/releases)`. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This release link is from a personal repo, shall we move the code and release into this repo? |
||||||||
2. Import `azure-webpubsub-transport.unitypackage` to your Unity project. | ||||||||
3. Add `AzureWebPubSubTransport` component to your GameObject containing your NetworkManager. | ||||||||
4. Set the `Network Transport` field on the NetworkManager to the `AzureWebPubSubTransport`. | ||||||||
5. Enter a room name into the `Room Name` field of the `AzureWebPubSubTransport`. | ||||||||
6. Enter negotiate endpoint. For example, `https://localhost:7172/negotiate` if you use the builtin developing negotiate server. | ||||||||
7. Use the `StartServer`, `StartHost` and `StartClient` functions as usually to host a game and have clients connect to it. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also add some screenshots? |
||||||||
|
||||||||
> At this point, you should be able to exchanges data between unity server and client. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
## Next Step | ||||||||
|
||||||||
For video tutorial, check out [From 0 to Unity Multiplayer Hero: 9 Steps Using Azure Web PubSub](https://www.youtube.com/watch?v=-0LlnojcMCs). | ||||||||
For more details, see [azure-web-pubsub-transport](https://github.com/albertxavier100/azure-web-pubsub-transport) | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is not from the azure repo, could we move the transport code into this repo?