public void UnLockItem(CraftMenu.CRAFT_TYPE type, int tier) { foreach (var fKey in mItemPool) { if (!fKey.Value.ContainsKey(tier)) { return; } foreach (var sKey in fKey.Value[tier]) { if (sKey.Value.Count == 0) { continue; } if (sKey.Value[0].UnLock) { continue; } if (sKey.Value[0].CraftPlace != type) { continue; } for (int i = 0; i < sKey.Value.Count; i++) { sKey.Value[i].UnLock = true; } } } }
public Dictionary <int, List <Items> > GetItems(CraftMenu.CRAFT_TYPE type) { Dictionary <int, List <Items> > dTemp = new Dictionary <int, List <Items> >(); foreach (var fKey in mItemPool) { foreach (var sKey in mItemPool[fKey.Key]) { foreach (var tKey in sKey.Value) { List <Items> lTemp = null; for (int i = 0; i < tKey.Value.Count; i++) { if (tKey.Value[i].CraftPlace != type) { break; } if (tKey.Value[i].IsUse) { continue; } Items temp = tKey.Value[i]; temp.IsUse = true; if (dTemp.TryGetValue(sKey.Key, out lTemp)) { lTemp.Add(temp); break; } else { lTemp = new List <Items>(); dTemp.Add(sKey.Key, lTemp); lTemp.Add(temp); break; } } } } } return(dTemp); }