private void OnChangedToggle(int index) { this.ItemType = index != 0 ? UnitListV2.ItemTypes.PieceUnits : UnitListV2.ItemTypes.PlayerUnits; if (Object.op_Inequality((Object)this.SortFilter, (Object)null)) { ((Component)this.SortFilter).get_gameObject().SetActive(this.ItemType == UnitListV2.ItemTypes.PlayerUnits); } if (Object.op_Inequality((Object)this.UnitSortFilterButton, (Object)null)) { this.UnitSortFilterButton.SetActive(this.ItemType == UnitListV2.ItemTypes.PlayerUnits); } if (Object.op_Inequality((Object)this.SortMode, (Object)null)) { this.SortMode.get_gameObject().SetActive(this.ItemType == UnitListV2.ItemTypes.PlayerUnits); } this.Page = 0; this.RefreshData(); }
public void RefreshData() { bool clear = false; if (this.mLastItemType != this.ItemType) { this.mLastItemType = this.ItemType; this.ClearItems(); clear = true; } switch (this.ItemType) { case UnitListV2.ItemTypes.PlayerUnits: this.RefreshUnit(clear); break; case UnitListV2.ItemTypes.PieceUnits: this.RefreshPieceUnit(clear); break; } }