using IVDataFormat; using TMPro; using UnityEngine; using UnityEngine.UI; public class EScrPvpTier : EScrCell { private Image imgTier; private Image imgTierNum; private TextMeshProUGUI txtTier; private TextMeshProUGUI txtPoint; //private GameObject goLineL; private TextMeshProUGUI[] txtEffectTs; private TextMeshProUGUI[] txtEffectValues; private GameObject[] goEffects; public override void InitCell() { Transform trfself = transform; imgTier = transform.Find("imgTier").GetComponent(); imgTierNum = transform.Find("imgTierNum").GetComponent(); txtTier = transform.Find("txtTier").GetComponent(); txtPoint = transform.Find("txtPoint").GetComponent(); //goLineL = trfself.Find("linel").gameObject; Transform trfeffect = trfself.Find("groupEffect"); int ilen = trfeffect.childCount; txtEffectTs = new TextMeshProUGUI[ilen]; txtEffectValues = new TextMeshProUGUI[ilen]; goEffects = new GameObject[ilen]; for (int i = 0; i < ilen; i++) { goEffects[i] = trfeffect.GetChild(i).gameObject; txtEffectTs[i] = trfeffect.GetChild(i).GetChild(0).GetComponent(); txtEffectValues[i] = trfeffect.GetChild(i).GetChild(1).GetComponent(); } } public override void ReleaseResources() { imgTier.sprite = null; imgTierNum.sprite = null; } public override void RefreshCellView() { SetData(itemID); } public override void SetData(int itemid) { itemID = itemid; dPvpTier tier = DataHandler.GetPvpTier(itemID + 1); // 티어 이미지 표시. imgTier.sprite = PvpMgr.SGetTierImg(tier.id); imgTierNum.sprite = PvpMgr.SGetTierNumImg(tier.id); txtTier.text = LocalizationText.GetText(FormatString.CombineAllString("tier", tier.id.ToString())); txtPoint.text = FormatString.TextRp(tier.condValue); switch (tier.id) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x - 4, imgTier.rectTransform.anchoredPosition.y + 3, 0); break; case 10: case 11: case 12: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x - 1, imgTier.rectTransform.anchoredPosition.y + 7, 0); break; case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 49: case 50: case 51: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x, imgTier.rectTransform.anchoredPosition.y + 2, 0); break; case 43: case 44: case 45: case 46: case 47: case 48: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x, imgTier.rectTransform.anchoredPosition.y, 0); break; case 52: case 53: case 54: case 55: case 56: case 57: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x, imgTier.rectTransform.anchoredPosition.y-5, 0); break; default: imgTierNum.rectTransform.anchoredPosition = new Vector3(imgTier.rectTransform.anchoredPosition.x, imgTier.rectTransform.anchoredPosition.y, 0); break; } #region Effects if (tier.abilityType1 == eEffectType.None) { goEffects[0].SetActive(false); } else { txtEffectTs[0].text = FormatString.TextEffectTitle(tier.abilityType1); txtEffectValues[0].text = FormatString.TextEffectValue(tier.abilityType1, tier.abilityValue1); goEffects[0].SetActive(true); } if (tier.abilityType2 == eEffectType.None) { goEffects[1].SetActive(false); } else { txtEffectTs[1].text = FormatString.TextEffectTitle(tier.abilityType2); txtEffectValues[1].text = FormatString.TextEffectValue(tier.abilityType2, tier.abilityValue2); goEffects[1].SetActive(true); } if (tier.abilityType3 == eEffectType.None) { goEffects[2].SetActive(false); } else { txtEffectTs[2].text = FormatString.TextEffectTitle(tier.abilityType3); txtEffectValues[2].text = FormatString.TextEffectValue(tier.abilityType3, tier.abilityValue3); goEffects[2].SetActive(true); } if (tier.abilityType4 == eEffectType.None) { goEffects[3].SetActive(false); } else { txtEffectTs[3].text = FormatString.TextEffectTitle(tier.abilityType4); txtEffectValues[3].text = FormatString.TextEffectValue(tier.abilityType4, tier.abilityValue4); goEffects[3].SetActive(true); } #endregion Effects } }