Пример #1
0
        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);
                }
            }
        }
        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;
            }
        }
Пример #4
0
        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);
        }
        // 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);
                }
            }
        }