Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit d205b04

Browse files
committed
Fixing a bug in Social and Stats prefabs between scenes (#98)
* Fixing a bug in Social and Stats prefabs between scenes
1 parent 537e444 commit d205b04

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Assets/Xbox Live/Scripts/Social.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,15 @@ private void Start()
5050
{
5151
this.XboxLiveUser = XboxLiveUserManager.Instance.GetSingleModeUser();
5252
}
53+
54+
if (this.XboxLiveUser != null && this.XboxLiveUser.User != null && this.XboxLiveUser.User.IsSignedIn)
55+
{
56+
this.CreateDefaultSocialGraphs();
57+
this.RefreshSocialGroups();
58+
}
5359
}
5460

61+
5562
private void Update()
5663
{
5764
if (!string.IsNullOrEmpty(this.verticalScrollInputAxis) && Input.GetAxis(this.verticalScrollInputAxis) != 0){
@@ -81,7 +88,7 @@ private void OnEventProcessed(object sender, SocialEvent socialEvent)
8188
case SocialEventType.LocalUserAdded:
8289
if (socialEvent.Exception == null)
8390
{
84-
this.CreateDefaulSocialGraphs();
91+
this.CreateDefaultSocialGraphs();
8592
}
8693
break;
8794
case SocialEventType.SocialUserGroupLoaded:
@@ -105,7 +112,7 @@ private void PresenceFilterValueChangedHandler(Dropdown target)
105112
this.RefreshSocialGroups();
106113
}
107114

108-
private void CreateDefaulSocialGraphs()
115+
private void CreateDefaultSocialGraphs()
109116
{
110117
XboxSocialUserGroup allSocialUserGroup = XboxLive.Instance.SocialManager.CreateSocialUserGroupFromFilters(this.XboxLiveUser.User, PresenceFilter.All, RelationshipFilter.Friends);
111118
this.socialUserGroups.Add(0, allSocialUserGroup);

Assets/Xbox Live/Scripts/Stats/StatBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ void Start()
4848
{
4949
this.XboxLiveUser = XboxLiveUserManager.Instance.GetSingleModeUser();
5050
}
51+
52+
if (this.XboxLiveUser != null && this.XboxLiveUser.User != null && this.XboxLiveUser.User.IsSignedIn)
53+
{
54+
this.HandleGetStat(this.XboxLiveUser.User, this.ID);
55+
}
5156
}
5257

5358
protected void Update()

0 commit comments

Comments
 (0)