public void setData(GameIDData gd, int slotIndex = -1) { slotType = BaseSlot.InventorySlotType.Normal; if (isInventorySlot) { index = slotIndex; setInventorySlot(gd); bool isLock = false; if (UIReinforceBarPanel.isReinforceMode && gd != null) { if (UIReinforceBarPanel.isTabSlot == false && index == UIReinforceBarPanel.originalSlotIndex) { isLock = true; } if (isLock == false) { select = (UIReinforceBarPanel.sourceListIndex.Contains(index)); } } else if (UIMultiSellPanel.isMultiSell && gd != null) { select = (UIMultiSellPanel.sourceListIndex.Contains(index)); } else if (UIComposePanel.isComposeMode && gd != null) { if (UIComposePanel.isTabSlot == false && index == UIComposePanel.originalSlotIndex) { isLock = true; } else if (UIComposePanel.originalData.rare != data.rare || data.reinforceLevel < GameIDData.MAX_LEVEL) { isLock = true; } if (isLock == false) { select = (UIComposePanel.sourceIndex == index); } } else { spLock.enabled = false; } spLock.enabled = isLock; btn.isEnabled = !isLock; if (spNew != null) { spNew.enabled = (data != null && data.isNew); } } else { setCategorySlot(gd); if (spLock != null) { spLock.enabled = false; } } }
public void setData(GameIDData gd, bool useCantUseCover = true, int slotIndex = -1) { slotType = BaseSlot.InventorySlotType.Normal; //gameObject.name = string.Empty; if (gd == null) { btn.isEnabled = false; data = null; spCantUse.gameObject.SetActive(false); spPartsIcon.gameObject.SetActive(false); spSelect.gameObject.SetActive(false); spRareBorder.gameObject.SetActive(true); spSlotRareBg.gameObject.SetActive(true); lbInforceLevel.gameObject.SetActive(false); spRareBorder.spriteName = SLOT_LINE_GRADE_NORMAL; spSlotRareBg.spriteName = SLOT_BG_GRADE_NORMAL; if (spLock != null) { spLock.enabled = false; } if (spLabelBg != null) { spLabelBg.enabled = false; } if (spNew != null) { spNew.enabled = false; } Util.setTranscendLevel(lbTranscendLevel); } else { btn.isEnabled = true; data = gd; if (UIReinforceBarPanel.isReinforceMode) { spCantUse.gameObject.SetActive(false); } else { spCantUse.gameObject.SetActive(data.partsData.character != UIHero.nowHero && useCantUseCover); } spSelect.gameObject.SetActive(false); spPartsIcon.gameObject.SetActive(true); spSlotRareBg.gameObject.SetActive(true); spRareBorder.gameObject.SetActive(true); spRareBorder.spriteName = RareType.getRareLineSprite(data.rare); spSlotRareBg.spriteName = RareType.getRareBgSprite(data.rare); Icon.setEquipIcon(data.partsData.getIcon(), spPartsIcon, iconDepth); lbInforceLevel.gameObject.SetActive(true); if (data.level > 0) { lbInforceLevel.text = "l" + data.level; } else { lbInforceLevel.text = "-"; } Util.setTranscendLevel(lbTranscendLevel, data.totalPLevel); index = slotIndex; bool isLock = false; if (UIReinforceBarPanel.isReinforceMode) { if (index == UIReinforceBarPanel.originalSlotIndex) { isLock = true; } if (isLock == false) { select = (UIReinforceBarPanel.sourceListIndex.Contains(index)); } } else if (UIMultiSellPanel.isMultiSell) { select = (UIMultiSellPanel.sourceListIndex.Contains(index)); } else if (UIComposePanel.isComposeMode) { if (index == UIComposePanel.originalSlotIndex) { isLock = true; } else if (UIComposePanel.originalData.rare != data.rare || data.reinforceLevel < GameIDData.MAX_LEVEL ) { isLock = true; } if (isLock == false) { select = (UIComposePanel.sourceIndex == index); } } else { spLock.enabled = false; } spLock.enabled = isLock; btn.isEnabled = !isLock; if (spLabelBg != null) { spLabelBg.enabled = true; } } if (spNew != null) { spNew.enabled = (data != null && data.isNew); } }