Skip to content

Commit a8878c1

Browse files
authored
Merge pull request #205547 from stefanhessel/tutorial-fix-connect-async
adjust documentation to code changes in RemoteRenderingCoordinator
2 parents e0bbba6 + f43854d commit a8878c1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

articles/remote-rendering/tutorials/unity/view-remote-models/view-remote-models.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public class RemoteRenderingCoordinator : MonoBehaviour
436436
//Implement me
437437
}
438438

439-
public void StopRemoteSession()
439+
public async void StopRemoteSession()
440440
{
441441
//Implement me
442442
}
@@ -470,7 +470,7 @@ public class RemoteRenderingCoordinator : MonoBehaviour
470470
/// <summary>
471471
/// Connects the local runtime to the current active session, if there's a session available
472472
/// </summary>
473-
public void ConnectRuntimeToRemoteSession()
473+
public async void ConnectRuntimeToRemoteSession()
474474
{
475475
//Implement me
476476
}
@@ -668,11 +668,11 @@ public async void JoinRemoteSession()
668668
}
669669
}
670670

671-
public void StopRemoteSession()
671+
public async void StopRemoteSession()
672672
{
673673
if (ARRSessionService.CurrentActiveSession != null)
674674
{
675-
ARRSessionService.CurrentActiveSession.StopAsync();
675+
await ARRSessionService.CurrentActiveSession.StopAsync();
676676
}
677677
}
678678
```
@@ -697,20 +697,19 @@ The application also needs to listen for events about the connection between the
697697
/// <summary>
698698
/// Connects the local runtime to the current active session, if there's a session available
699699
/// </summary>
700-
public void ConnectRuntimeToRemoteSession()
700+
public async void ConnectRuntimeToRemoteSession()
701701
{
702702
if (ARRSessionService == null || ARRSessionService.CurrentActiveSession == null)
703703
{
704704
Debug.LogError("Not ready to connect runtime");
705705
return;
706706
}
707707

708-
//Connect the local runtime to the currently connected session
709-
//This session is set when connecting to a new or existing session
708+
// Connect the local runtime to the currently connected session
709+
// This session is set when connecting to a new or existing session
710710
711711
ARRSessionService.CurrentActiveSession.ConnectionStatusChanged += OnLocalRuntimeStatusChanged;
712-
ARRSessionService.CurrentActiveSession.ConnectAsync(new RendererInitOptions());
713-
CurrentCoordinatorState = RemoteRenderingState.ConnectingToRuntime;
712+
await ARRSessionService.CurrentActiveSession.ConnectAsync(new RendererInitOptions());
714713
}
715714

716715
public void DisconnectRuntimeFromRemoteSession()

0 commit comments

Comments
 (0)