|
@@ -729,6 +729,73 @@ namespace GFGGame
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static IEnumerator GetAllDressUpGuideIdListBySubTypeAsync(Action<List<int>> onComplete)
|
|
|
|
+ {
|
|
|
|
+ List<ItemCfg> itemCfgs = new List<ItemCfg>();
|
|
|
|
+ List<int> result = new List<int>();
|
|
|
|
+
|
|
|
|
+ // 除饰品外的散件
|
|
|
|
+ for (int i = 0; i < dressUpGuideSubType.Length; i++)
|
|
|
|
+ {
|
|
|
|
+ itemCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.DRESS_UP, dressUpGuideSubType[i]));
|
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 饰品
|
|
|
|
+ for (int i = 0; i < dressUpGuideAccessoriesType.Length; i++)
|
|
|
|
+ {
|
|
|
|
+ itemCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.DRESS_UP, dressUpGuideAccessoriesType[i]));
|
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 特殊
|
|
|
|
+ ItemTypeCfg[] itemTypeCfg = ItemTypeCfgArray.Instance.dataArray;
|
|
|
|
+ for (int i = 0; i < itemTypeCfg.Length; i++)
|
|
|
|
+ {
|
|
|
|
+ if (itemTypeCfg[i].type > ConstDressUpItemType.TE_SHU)
|
|
|
|
+ {
|
|
|
|
+ itemCfgs.AddRange(ItemCfgArray.Instance.GetCfgsByitemTypeAndsubType(ConstItemType.DRESS_UP, itemTypeCfg[i].type));
|
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ itemCfgs.Sort((a, b) =>
|
|
|
|
+ {
|
|
|
|
+ bool haveA = CheckHasItem(a.id);
|
|
|
|
+ bool haveB = CheckHasItem(b.id);
|
|
|
|
+
|
|
|
|
+ if (haveB && !haveA)
|
|
|
|
+ {
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ else if (!haveB && haveA)
|
|
|
|
+ {
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (a.rarity != b.rarity)
|
|
|
|
+ {
|
|
|
|
+ return a.rarity > b.rarity ? -1 : 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return a.res.CompareTo(b.res);
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < itemCfgs.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ if (itemCfgs[i].isHide <= 0)
|
|
|
|
+ {
|
|
|
|
+ result.Add(itemCfgs[i].id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onComplete?.Invoke(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
public static void SortDressUpGuideIdList(List<int> list)
|
|
public static void SortDressUpGuideIdList(List<int> list)
|
|
{
|
|
{
|
|
list.Sort((a, b) =>
|
|
list.Sort((a, b) =>
|