public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview) { AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal); if (rgView == rgStyleType) { mStyleType = EnumUtil.GetEnum <StoreForDressTypeEnum>(rbview.name); } else if (rgView == rgPartType) { mPartType = EnumUtil.GetEnum <GeneralEnum>(rbview.name); } InitDataByType(mStyleType, mPartType); }
/// <summary> /// 根据类型和部位初始化数据 /// </summary> /// <param name="styleType"></param> /// <param name="partType"></param> public void InitDataByType(StoreForDressTypeEnum styleType, GeneralEnum partType) { List <StoreInfoBean> createListData = new List <StoreInfoBean>(); switch (partType) { case GeneralEnum.Null: createListData = mClothesListData; break; case GeneralEnum.Mask: case GeneralEnum.Hat: case GeneralEnum.Clothes: case GeneralEnum.Shoes: createListData = GetClothesListDataByPart(partType); break; } List <StoreInfoBean> listData = GetClothesListDataByType(styleType, createListData); CreateClothesData(listData); }
/// <summary> /// 根据类型获取数据 /// </summary> /// <param name="mark"></param> /// <returns></returns> public List <StoreInfoBean> GetClothesListDataByType(StoreForDressTypeEnum styleType, List <StoreInfoBean> listStoreData) { if (styleType == 0) { return(listStoreData); } List <StoreInfoBean> listData = new List <StoreInfoBean>(); if (listStoreData == null) { return(listData); } for (int i = 0; i < listStoreData.Count; i++) { StoreInfoBean itemData = listStoreData[i]; if (itemData.store_goods_type == (int)styleType) { listData.Add(itemData); } } return(listData); }