private void InitSlotByType(List <RunePageInfo.RuneSlotInfo> rundSlotInfoList, RuneSlotType type, Transform slottransform) { for (int i = 0; i < rundSlotInfoList.Count; i++) { RunePageInfo.RuneSlotInfo runeSlot = rundSlotInfoList[i]; RuneSlotItem runeSlotItem = slottransform.GetChild(i).GetComponent <RuneSlotItem>(); runeSlotItem.slotType = type; runeSlotItem.state = (RuneSlotState)runeSlot.state; runeSlotItem.slotId = runeSlot.id; runeSlotItem.itemId = runeSlot.itemId; runeSlotItem.pageId = currentRunePageId; runeSlotItem.gameObject.GetComponent <Toggle>().isOn = false; if (runeSlot.itemId != 0 && runeSlotItem.state == RuneSlotState.INLAID) { runeSlotItem.runeIcon = controller.GetRuneIcon(runeSlot.itemId); slotPageTotalLevel += controller.GetRuneLevel(runeSlot.itemId); } if (runeSlotItem.state == RuneSlotState.CAN_BUY) { canBuyRuneSoltList.Add(runeSlotItem); } runeSlotItem.InitItem(); AddSlotOnClick(runeSlotItem); } }
private void HandleUnEquipRuneFeedback(byte[] data) { UnEquipRuneS2C feedback = ProtobufUtils.Deserialize <UnEquipRuneS2C> (data); if (feedback.result) { RunePageInfo.RuneSlotInfo slot = runePages.Find(t => t.pageId == _view.currentRunePageId).slots.Find(a => a.id == _view.currentSlotId); slot.state = (int)RuneSlotState.UNLOCK; slot.itemId = 0; _view.LoadRunePageItem(); _view.RefreshRuneSlotItem(); _view.LoadRunePackItem(); _view.ShowRunePageInformationPanel(); } }
public Dictionary <int, float[]> GetRunePageAttribute(int runePageId) { List <RunePageInfo.RuneSlotInfo> slotList = runePageList.Find(p => p.pageId == runePageId).slots; List <int> runeIdList = new List <int> (); for (int i = 0; i < slotList.Count; i++) { RunePageInfo.RuneSlotInfo runeSlot = slotList[i]; if (runeSlot.itemId != 0) { runeIdList.Add(runeSlot.itemId); } } Dictionary <int, float[]> attributes = new Dictionary <int, float[]> (); List <RuneProto.Rune> runes = DataManager.GetInstance().runeProtoData; for (int i = 0; i < runeIdList.Count; i++) { int runeId = runeIdList[i]; RuneProto.Rune rune = runes.Find(p => p.ID == runeId); int property1 = rune.Property1; int addition1 = rune.Addition1; float value1 = rune.Value1; int property2 = rune.Property2; int addition2 = rune.Addition2; float value2 = rune.Value2; int property3 = rune.Property3; int addition3 = rune.Addition3; float value3 = rune.Value3; int property4 = rune.Property4; int addition4 = rune.Addition4; float value4 = rune.Value4; AddRunePageAttribute(attributes, property1, addition1, value1); AddRunePageAttribute(attributes, property2, addition2, value2); AddRunePageAttribute(attributes, property3, addition3, value3); AddRunePageAttribute(attributes, property4, addition4, value4); } return(attributes); }