Exemple #1
0
        private IEnumerator FinishLoadingProfileInfo()
        {
            this.playerNumberText.color = ThemeHelper.GetThemeBaseFontColor(this.Theme);
            var socialUser = userGroup.GetUsersFromXboxUserIds(new List <string> {
                this.xboxLiveUser.XboxUserId
            })[0];

            var www = new WWW(socialUser.DisplayPicRaw + "&w=128");

            yield return(www);

            try
            {
                if (www.isDone && string.IsNullOrEmpty(www.error))
                {
                    var t = www.texture;
                    var r = new Rect(0, 0, t.width, t.height);
                    this.gamerpic.sprite = Sprite.Create(t, r, Vector2.zero);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Instance.ThrowException(
                    ExceptionSource.PlayerAuthentication,
                    ExceptionType.LoadGamerPicFailed,
                    ex);
            }
            this.Refresh();
        }
Exemple #2
0
        private IEnumerator FinishLoadingProfileInfo()
        {
            this.playerNumberText.color = ThemeHelper.GetThemeBaseFontColor(this.Theme);
            var socialUser = userGroup.GetUsersFromXboxUserIds(new List <string> {
                this.xboxLiveUser.XboxUserId
            })[0];

            var www = new WWW(socialUser.DisplayPicRaw + "&w=128");

            yield return(www);

            try
            {
                if (www.isDone && string.IsNullOrEmpty(www.error))
                {
                    var t = www.texture;
                    var r = new Rect(0, 0, t.width, t.height);
                    this.gamerpic.sprite = Sprite.Create(t, r, Vector2.zero);
                }
            }
            catch (Exception ex)
            {
                if (XboxLiveServicesSettings.Instance.DebugLogsOn)
                {
                    Debug.Log("There was an error while loading Profile Info. Exception: " + ex.Message);
                }
            }
            this.Refresh();
        }
Exemple #3
0
    private IEnumerator FinishLoadingProfileInfo()
    {
        var socialUser = userGroup.GetUsersFromXboxUserIds(new List <string> {
            this.XboxLiveUser.User.XboxUserId
        })[0];

        var www = new WWW(socialUser.DisplayPicUrlRaw + "&w=128");

        yield return(www);

        try
        {
            if (www.isDone && string.IsNullOrEmpty(www.error))
            {
                var t = www.texture;
                var r = new Rect(0, 0, t.width, t.height);
                this.gamerpic.sprite = Sprite.Create(t, r, Vector2.zero);
            }

            this.gamerscore.text = socialUser.Gamerscore;

            if (socialUser.PreferredColor != null)
            {
                this.profileInfoPanel.GetComponent <Image>().color =
                    ColorFromHexString(socialUser.PreferredColor.PrimaryColor);
                this.gamerpicMask.color = ColorFromHexString(socialUser.PreferredColor.PrimaryColor);
            }
        }
        catch (Exception ex)
        {
            if (XboxLiveServicesSettings.Instance.DebugLogsOn)
            {
                Debug.Log("There was an error while loading Profile Info. Exception: " + ex.Message);
            }
        }

        this.Refresh();
    }