Skip to content

Commit 60cb6bb

Browse files
authored
Merge pull request #223 from HodgsonSDAS/master
Fixes remote head manager
2 parents a0b6193 + 713b319 commit 60cb6bb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Assets/HoloToolkit/Sharing/Tests/RemoteHeadManager.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,30 @@ void Update()
4646
}
4747

4848
/// <summary>
49-
/// Called when a new user is leaving.
49+
/// Called when an existing user leaves the session.
5050
/// </summary>
5151
/// <param name="sender"></param>
5252
/// <param name="e"></param>
5353
private void Instance_SessionLeft(object sender, SharingSessionTracker.SessionLeftEventArgs e)
5454
{
55-
RemoveRemoteHead(this.remoteHeads[e.exitingUserId].HeadObject);
56-
this.remoteHeads.Remove(e.exitingUserId);
55+
if (e.exitingUserId != SharingStage.Instance.Manager.GetLocalUser().GetID())
56+
{
57+
RemoveRemoteHead(this.remoteHeads[e.exitingUserId].HeadObject);
58+
this.remoteHeads.Remove(e.exitingUserId);
59+
}
5760
}
5861

5962
/// <summary>
60-
/// Called when a user is joining.
63+
/// Called when a remote user is joins the session.
6164
/// </summary>
6265
/// <param name="sender"></param>
6366
/// <param name="e"></param>
6467
private void Instance_SessionJoined(object sender, SharingSessionTracker.SessionJoinedEventArgs e)
6568
{
66-
GetRemoteHeadInfo(e.joiningUser.GetID());
69+
if (e.joiningUser.GetID() != SharingStage.Instance.Manager.GetLocalUser().GetID())
70+
{
71+
GetRemoteHeadInfo(e.joiningUser.GetID());
72+
}
6773
}
6874

6975
/// <summary>

0 commit comments

Comments
 (0)