示例#1
0
        private void Awake()
        {
            SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;

            if (currentValue == null)
            {
                return;
            }
            this.mSettings = currentValue.GetObject("settings") as GalleryItemListWindow.Settings;
            if (this.mSettings == null)
            {
                return;
            }
            this.AscButton.set_isOn(this.mSettings.isRarityAscending);
            this.DescButton.set_isOn(!this.mSettings.isRarityAscending);
            this.mCurrentSortType   = this.mSettings.sortType;
            this.mIsRarityAscending = this.mSettings.isRarityAscending;
            this.mIsNameAscending   = this.mSettings.isNameAscending;
            if (this.mCurrentSortType == GalleryItemListWindow.SortType.Rarity)
            {
                this.RarityButton.set_isOn(true);
                this.NameButton.set_isOn(false);
                this.AscButton.set_isOn(this.mIsRarityAscending);
                this.DescButton.set_isOn(!this.mIsRarityAscending);
            }
            else
            {
                this.RarityButton.set_isOn(false);
                this.NameButton.set_isOn(true);
                this.AscButton.set_isOn(this.mIsNameAscending);
                this.DescButton.set_isOn(!this.mIsNameAscending);
            }
        }
        private void Awake()
        {
            SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;

            if (currentValue == null)
            {
                return;
            }
            this.mSettings = currentValue.GetObject("settings") as GalleryItemListWindow.Settings;
            if (this.mSettings == null)
            {
                return;
            }
            this.mRareFiltters = ((IEnumerable <int>) this.mSettings.rareFilters).OrderBy <int, int>((Func <int, int>)(x => x)).ToList <int>();
            foreach (Toggle mToggle in this.mToggles)
            {
                mToggle.set_isOn(false);
            }
            if (this.mToggles != null && this.mToggles.Length >= 0)
            {
                using (List <int> .Enumerator enumerator = this.mRareFiltters.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        int current = enumerator.Current;
                        if (current >= 0 && current < this.mToggles.Length)
                        {
                            this.mToggles[current].set_isOn(true);
                        }
                    }
                }
            }
            if (this.mToggles == null || this.mToggles.Length < 0)
            {
                return;
            }
            for (int index = 0; index < this.mToggles.Length; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: method pointer
                ((UnityEvent <bool>) this.mToggles[index].onValueChanged).AddListener(new UnityAction <bool>((object)new GalleryFilterWindow.\u003CAwake\u003Ec__AnonStorey348()
                {
                    \u003C\u003Ef__this = this,
                    index = index
                }, __methodptr(\u003C\u003Em__33C)));
            }
        }
 private void Start()
 {
     this.mCellCount         = this.GetCellCount();
     this.mCurrentTabType    = EItemTabType.Used;
     this.mSettings          = this.LoadSetting();
     this.mSortType          = this.mSettings.sortType;
     this.mIsRarityAscending = this.mSettings.isRarityAscending;
     this.mIsNameAscending   = this.mSettings.isNameAscending;
     this.mRareFilters       = this.mSettings.rareFilters;
     this.ChangeFilterButtonSprite();
     this.ChangeSortButtonText();
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
     {
         this.ItemTemplate.SetActive(false);
     }
     this.RefreshNewPage(this.mCurrentTabType, 0);
 }
        private GalleryItemListWindow.Settings LoadSetting()
        {
            if (PlayerPrefsUtility.HasKey(PlayerPrefsUtility.GALLERY_SETTING))
            {
                string str = PlayerPrefsUtility.GetString(PlayerPrefsUtility.GALLERY_SETTING, string.Empty);
                if (!string.IsNullOrEmpty(str))
                {
                    return((GalleryItemListWindow.Settings)JsonUtility.FromJson <GalleryItemListWindow.Settings>(str));
                }
            }
            GalleryItemListWindow.Settings settings = new GalleryItemListWindow.Settings();
            settings.sortType          = GalleryItemListWindow.SortType.Rarity;
            settings.isRarityAscending = true;
            settings.isNameAscending   = true;
            settings.rareFilters       = GalleryItemListWindow.DefaultFilter;
            string json = JsonUtility.ToJson((object)settings);

            PlayerPrefsUtility.SetString(PlayerPrefsUtility.GALLERY_SETTING, json, true);
            return(settings);
        }
        private void SaveSetting(GalleryItemListWindow.Settings settings)
        {
            string json = JsonUtility.ToJson((object)settings);

            PlayerPrefsUtility.SetString(PlayerPrefsUtility.GALLERY_SETTING, json, true);
        }