Exemple #1
0
        public void Start()
        {
            // Disable the sign-in button if there's no configuration available.
            if (!XboxLiveServicesSettings.EnsureXboxLiveServiceConfiguration())
            {
                this.ConfigAvailable = false;

                Text signInButtonText = this.signInPanel.GetComponentInChildren <Button>().GetComponentInChildren <Text>(true);
                if (signInButtonText != null)
                {
                    signInButtonText.fontSize = 16;
                    signInButtonText.text     = "Xbox Live is not enabled.\nSee errors for detail.";
                }
            }
            this.playerNumberText.text = "P" + this.PlayerNumber;
            this.Refresh();

            try
            {
                SocialManagerComponent.Instance.EventProcessed += SocialManagerEventProcessed;
                SignInManager.Instance.OnPlayerSignOut(this.PlayerNumber, this.OnPlayerSignOut);
                SignInManager.Instance.OnPlayerSignIn(this.PlayerNumber, this.OnPlayerSignIn);
                this.xboxLiveUser = SignInManager.Instance.GetPlayer(this.PlayerNumber);
                if (this.xboxLiveUser != null)
                {
                    this.LoadProfileInfo();
                }
            }
            catch (Exception ex)
            {
                Debug.LogWarning(ex.Message);
            }

            this.StartCoroutine(this.LoadTheme());
        }
 public void Start()
 {
     // Super simple check to determine if configuration is non-empty.  This is not a thorough check to determine if the configuration is valid.
     // A user can easly bypass this check which will just cause them to fail at runtime if they try to use any functionality.
     if (!XboxLiveServicesSettings.EnsureXboxLiveServiceConfiguration() && Application.isPlaying)
     {
         const string message = "Xbox Live is not configured, but the game is attempting to use Xbox Live functionality.  You must update the configuration in 'Xbox Live > Configuration' before building the game to enable Xbox Live.";
         if (Application.isEditor && XboxLiveServicesSettings.Instance.DebugLogsOn)
         {
             Debug.LogWarning(message);
         }
         else
         {
             if (XboxLiveServicesSettings.Instance.DebugLogsOn)
             {
                 Debug.LogError(message);
             }
         }
     }
 }