private void Awake() { this.EnsureEventSystem(); XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); this.StatLabelText.text = string.Empty; this.StatValueText.text = string.Empty; }
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()); }
private void Awake() { this.EnsureEventSystem(); XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); this.entryObjectPool = this.GetComponent <ObjectPool>(); SocialManagerComponent.Instance.EventProcessed += this.OnEventProcessed; this.presenceFilterDropdown.options.Clear(); this.presenceFilterDropdown.options.Add(new Dropdown.OptionData() { text = PresenceFilter.All.ToString() }); this.presenceFilterDropdown.options.Add(new Dropdown.OptionData() { text = "All Online" }); this.presenceFilterDropdown.value = 0; this.presenceFilterDropdown.RefreshShownValue(); this.presenceFilterDropdown.onValueChanged.AddListener(delegate { this.PresenceFilterValueChangedHandler(this.presenceFilterDropdown); }); if (this.EnableControllerInput) { if (this.ToggleFilterButton != XboxControllerButtons.None) { this.toggleFilterControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.ToggleFilterButton); } } SignInManager.Instance.OnPlayerSignOut(this.PlayerNumber, this.OnPlayerSignOut); }
private void Awake() { XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); // Ensure that a StatsManager has been created so that stats will be sync with the service as they are modified. var statsManager = StatsManagerComponent.Instance; }
// Use this for initialization void Start() { XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); this.logText = string.Empty; this.gameSaveHelper = new GameSaveHelper(); this.logLines = new List <string>(); this.xboxLiveUser = SignInManager.Instance.GetPlayer(this.PlayerNumber); if (this.xboxLiveUser != null && this.xboxLiveUser.IsSignedIn) { this.InitializeSaveSystem(); } else { SignInManager.Instance.OnPlayerSignIn(this.PlayerNumber, this.OnPlayerSignIn); SignInManager.Instance.OnPlayerSignOut(this.PlayerNumber, this.OnPlayerSignOut); } if (this.EnableControllerInput) { if (this.GenerateDataButton != XboxControllerButtons.None) { this.generateNewControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.GenerateDataButton); } if (this.SaveDataButton != XboxControllerButtons.None) { this.saveDataControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.SaveDataButton); } if (this.LoadDataButton != XboxControllerButtons.None) { this.loadDataControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.LoadDataButton); } if (this.GetInfoButton != XboxControllerButtons.None) { this.getInfoControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.GetInfoButton); } if (this.DeleteContainerButton != XboxControllerButtons.None) { this.deleteContainerControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.DeleteContainerButton); } } }
public void Awake() { this.EnsureEventSystem(); XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); if (this.EnableControllerInput) { if (this.SignInButton != XboxControllerButtons.None) { this.signInInputButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.SignInButton); } if (this.SignOutButton != XboxControllerButtons.None) { this.signOutInputButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.SignOutButton); } } }
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); } } } }
private void Awake() { this.EnsureEventSystem(); XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); this.ViewSelector.Theme = this.Theme; this.entryObjectPool = this.GetComponent <ObjectPool>(); if (EnableControllerInput) { if (this.NextPageControllerButton != XboxControllerButtons.None) { this.nextControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.NextPageControllerButton); this.NextPageImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.NextPageControllerButton); this.NextPageImage.SetNativeSize(); } else { this.NextPageImage.enabled = false; } if (this.PreviousPageControllerButton != XboxControllerButtons.None) { this.prevControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.PreviousPageControllerButton); this.PreviousPageImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.PreviousPageControllerButton); this.PreviousPageImage.SetNativeSize(); } else { this.PreviousPageImage.enabled = false; } if (this.NextViewControllerButton != XboxControllerButtons.None) { this.nextViewControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.NextViewControllerButton); this.NextViewImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.NextViewControllerButton); this.NextViewImage.SetNativeSize(); } else { this.NextViewImage.enabled = false; } if (this.PrevViewControllerButton != XboxControllerButtons.None) { this.prevViewControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.PrevViewControllerButton); this.PrevViewImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.PrevViewControllerButton); this.PrevViewImage.SetNativeSize(); } else { this.PrevViewImage.enabled = false; } } else { this.NextViewImage.enabled = false; this.PrevViewImage.enabled = false; this.NextPageImage.enabled = false; this.PreviousPageImage.enabled = false; } }
private void Awake() { this.EnsureEventSystem(); XboxLiveServicesSettings.EnsureXboxLiveServicesSettings(); this.ViewSelector.Theme = this.Theme; this.ViewSelector.SelectFilter((int)this.viewFilter); if (this.stat == null) { if (XboxLiveServicesSettings.Instance.DebugLogsOn) { Debug.LogFormat("Leaderboard '{0}' does not have a stat configured and will not function properly.", this.name); } return; } this.HeaderText.text = this.stat.DisplayName.ToUpper(); this.entryObjectPool = this.GetComponent <ObjectPool>(); this.UpdateButtons(); SocialManagerComponent.Instance.EventProcessed += this.SocialManagerEventProcessed; StatsManagerComponent.Instance.LocalUserAdded += this.LocalUserAdded; StatsManagerComponent.Instance.GetLeaderboardCompleted += this.GetLeaderboardCompleted; SignInManager.Instance.OnPlayerSignOut(this.PlayerNumber, this.OnPlayerSignOut); this.statsAddedLocalUser = false; this.socialAddedLocalUser = false; if (EnableControllerInput) { if (this.NextPageControllerButton != XboxControllerButtons.None) { this.nextControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.NextPageControllerButton); this.NextPageImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.NextPageControllerButton); this.NextPageImage.SetNativeSize(); } else { this.NextPageImage.enabled = false; } if (this.PreviousPageControllerButton != XboxControllerButtons.None) { this.prevControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.PreviousPageControllerButton); this.PreviousPageImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.PreviousPageControllerButton); this.PreviousPageImage.SetNativeSize(); } else { this.PreviousPageImage.enabled = false; } if (this.NextViewControllerButton != XboxControllerButtons.None) { this.nextViewControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.NextViewControllerButton); this.NextViewImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.NextViewControllerButton); this.NextViewImage.SetNativeSize(); } else { this.NextViewImage.enabled = false; } if (this.PrevViewControllerButton != XboxControllerButtons.None) { this.prevViewControllerButton = "joystick " + this.JoystickNumber + " button " + XboxControllerConverter.GetUnityButtonNumber(this.PrevViewControllerButton); this.PrevViewImage.sprite = XboxControllerConverter.GetXboxButtonSpite(this.Theme, this.PrevViewControllerButton); this.PrevViewImage.SetNativeSize(); } else { this.PrevViewImage.enabled = false; } } else { this.NextViewImage.enabled = false; this.PrevViewImage.enabled = false; this.NextPageImage.enabled = false; this.PreviousPageImage.enabled = false; } }