void ReinforceItemSuccess() { if (ItemDataViewer.DefaultInstance.GetCurrentTargetItem().GetItemType() == Item.E_TYPE.EQUIPMENT) { EquipmentItem item = m_Item as EquipmentItem; EquipmentItem titem = ItemDataViewer.DefaultInstance.GetCurrentTargetItem() as EquipmentItem; if (!item || !titem) { return; } titem.IncreaseReinforceCount(item.GetReinforceCount() + 1); } else if (ItemDataViewer.DefaultInstance.GetCurrentTargetItem().GetItemType() == Item.E_TYPE.CHARACTER) { CharacterItem item = m_Item as CharacterItem; CharacterItem titem = ItemDataViewer.DefaultInstance.GetCurrentTargetItem() as CharacterItem; if (!item || !titem) { return; } titem.IncreaseReinforceCount(item.GetReinforceCount() + 1); } InventoryManager.Instance.DestroyItem(m_Item); InventoryViewer.RefreshAllSlots(); ItemDataViewer.DefaultInstance.Refresh(); m_LobbyCanvasUI.GetStatusUI().Refresh(); }
public void SetData(CharacterItem _Item) { m_Item = _Item; if (!m_Item) { m_ItemImage.sprite = null; for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { m_Stars[i].gameObject.SetActive(false); } return; } m_ItemImage.sprite = m_Item.m_ItemImage; for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { m_Stars[i].gameObject.SetActive(true); if (m_Item.GetReinforceCount() > i) { m_Stars[i].sprite = m_StarGold; } else { m_Stars[i].sprite = m_StarBlack; } } }
void ReinforceItem() { if (ItemDataViewer.DefaultInstance.GetCurrentTargetItem().GetItemType() == Item.E_TYPE.EQUIPMENT) { EquipmentItem item = m_Item as EquipmentItem; EquipmentItem titem = ItemDataViewer.DefaultInstance.GetCurrentTargetItem() as EquipmentItem; if (!item || !titem) { return; } if (item.m_EquipState.IsEquip) { MessageBox.CreateOneButtonType("장착중인 아이템은 강화재료로 사용 할 수 없습니다"); return; } if (item.GetReinforceCount() > 0) { MessageBox.CreateTwoButtonType("이 아이템은 강화가 되어있습니다. 정말로 재료로 사용하시겠습니까?", "YES", ReinforceItemSuccess, "NO"); return; } } else if (ItemDataViewer.DefaultInstance.GetCurrentTargetItem().GetItemType() == Item.E_TYPE.CHARACTER) { CharacterItem item = m_Item as CharacterItem; CharacterItem titem = ItemDataViewer.DefaultInstance.GetCurrentTargetItem() as CharacterItem; if (!item || !titem) { return; } if (item.m_EquipState.IsEquip) { MessageBox.CreateOneButtonType("장착중인 아이템은 강화재료로 사용 할 수 없습니다"); return; } if (item.GetReinforceCount() > 0) { MessageBox.CreateTwoButtonType("이 아이템은 강화가 되어있습니다. 정말로 재료로 사용하시겠습니까?", "YES", ReinforceItemSuccess, "NO"); return; } } ReinforceItemSuccess(); }
public void Refresh() { if (m_Item == null || m_Item.IsDestoryed) { gameObject.SetActive(false); } m_ItemImage.sprite = m_Item.m_ItemImage; m_StockCount.gameObject.SetActive(false); if (m_Item.GetItemType() == Item.E_TYPE.EQUIPMENT) { EquipmentItem equip = m_Item as EquipmentItem; if (equip.m_EquipState.IsEquip) { m_OutlineBoxImage.sprite = m_OutlineYellow; } else { m_OutlineBoxImage.sprite = m_OutlineBlack; } for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { if (equip.GetReinforceCount() > i) { m_Stars[i].sprite = m_StarGold; } else { m_Stars[i].sprite = m_StarBlack; } } } else if (m_Item.GetItemType() == Item.E_TYPE.CHARACTER) { CharacterItem equip = m_Item as CharacterItem; if (equip.m_EquipState.IsEquip) { m_OutlineBoxImage.sprite = m_OutlineYellow; } else { m_OutlineBoxImage.sprite = m_OutlineBlack; } for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { if (equip.GetReinforceCount() > i) { m_Stars[i].sprite = m_StarGold; } else { m_Stars[i].sprite = m_StarBlack; } } } else if (m_Item.GetItemType() == Item.E_TYPE.CONSUME) { m_StockCount.gameObject.SetActive(true); m_StockCount.text = m_Item.m_StockCount.ToString(); } }
public void SetData(Item _Item) { m_Item = _Item; m_NameText.text = m_Item.m_ItemName; m_IconImage.sprite = m_Item.m_ItemImage; if (m_Item.m_IsStockable) { m_StockText.gameObject.SetActive(true); m_StockText.text = "보유수: " + m_Item.m_StockCount.ToString(); } else { m_StockText.gameObject.SetActive(false); } if (m_Item.GetItemType() == Item.E_TYPE.EQUIPMENT) { m_ReinforceButton.SetActive(true); EquipmentItem eitem = m_Item as EquipmentItem; if (eitem) { for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { if (eitem.GetReinforceCount() > i) { m_Stars[i].sprite = m_StarGold; } else { m_Stars[i].sprite = m_StarBlack; } } if (eitem.GetState().IsEquip) { m_EquipmentButton.SetActive(false); m_EquipmentOffButton.SetActive(true); } else { m_EquipmentButton.SetActive(true); m_EquipmentOffButton.SetActive(false); } string defualtmanual = m_Item.m_DefaultManual; for (int i = 0; i < (int)EquipmentItem.E_ITEMSTATE.MAX; ++i) { defualtmanual = defualtmanual.Replace("&" + i.ToString() + "&", ((int)(eitem.GetEquipmentItemState((EquipmentItem.E_ITEMSTATE)i))).ToString()); } m_DefaultManualText.text = defualtmanual; m_EffectManualText.text = eitem.GetActiveSkillManualText(); string[] strAry = eitem.GetPassiveSkillManualText(); if (strAry != null && strAry.Length > 0) { for (int i = 0; i < strAry.Length; ++i) { m_EffectManualText.text += "\n" + strAry[i]; } } } else { m_DefaultManualText.text = m_Item.m_DefaultManual; m_EffectManualText.text = ""; } } else if (m_Item.GetItemType() == Item.E_TYPE.CHARACTER) { m_ReinforceButton.SetActive(true); CharacterItem eitem = m_Item as CharacterItem; if (eitem) { for (int i = 0; i < Common.MAXREINFORECEVALUE; ++i) { if (eitem.GetReinforceCount() > i) { m_Stars[i].sprite = m_StarGold; } else { m_Stars[i].sprite = m_StarBlack; } } if (eitem.GetState().IsEquip) { m_EquipmentButton.SetActive(false); m_EquipmentOffButton.SetActive(false); } else { m_EquipmentButton.SetActive(true); m_EquipmentOffButton.SetActive(false); } } m_DefaultManualText.text = m_Item.m_DefaultManual; m_EffectManualText.text = ""; } else { m_ReinforceButton.SetActive(false); m_EquipmentButton.SetActive(false); m_EquipmentOffButton.SetActive(false); m_DefaultManualText.text = m_Item.m_DefaultManual; m_EffectManualText.text = ""; } }