Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions samples/csharp/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
* [A simple chat demo using Microsoft Entra authentication](./chatapp-microsoft-entra-id)
* [A client-only publish/subscribe messages using WebSocket subprotocol](./clientpubsub)
* [A log streaming sample using the WebSocket subprotocol](./logstream)
* [A unity multiplayer sample](./unity-multiplayer-sample/)
* [A unity Multiplayer VR sample](./unity-multiplayer-VR-sample/)
34 changes: 34 additions & 0 deletions samples/csharp/unity-multiplayer-VR-sample/Readme.md
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 sample shows 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.

Copy link
Member

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?


> 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.
Copy link
Member

Choose a reason for hiding this comment

The 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)`.
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> At this point, you should be able to exchanges data between unity server and client.
> At this point, you should be able to exchange data between unity server and client.


## 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)

Loading