|
|
@ -1,4 +1,4 @@ |
|
|
|
using IVDataFormat; |
|
|
|
using IVDataFormat; |
|
|
|
using System.Numerics; |
|
|
|
using TMPro; |
|
|
|
using UnityEngine; |
|
|
@ -6,26 +6,17 @@ using UnityEngine.UI; |
|
|
|
|
|
|
|
public class GoodsEfcItem : GoodsItem |
|
|
|
{ |
|
|
|
#region UI
|
|
|
|
private Transform trfShineEffect; |
|
|
|
private Transform trfTopEffect; |
|
|
|
private RectTransform rtrf; |
|
|
|
#endregion UI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static readonly int _rarityParam = Animator.StringToHash("Rarity"); |
|
|
|
|
|
|
|
[SerializeField] private Animator rarityEffectAnimator; |
|
|
|
|
|
|
|
protected override void Init() |
|
|
|
{ |
|
|
|
rtrf = GetComponent<RectTransform>(); |
|
|
|
imgBg = GetComponent<Image>(); |
|
|
|
imgIcon = transform.Find("icon").GetComponent<Image>(); |
|
|
|
imgRarity = transform.Find("rarity").GetComponent<Image>(); |
|
|
|
imgStars = transform.Find("stars").GetComponentsInChildren<Image>(); |
|
|
|
txtRarity = transform.Find("txtRarity").GetComponent<TextMeshProUGUI>(); |
|
|
|
trfShineEffect = transform.Find("ShineEffect"); |
|
|
|
trfTopEffect = transform.Find("gachaTopEffect"); |
|
|
|
txtCount = transform.Find("txtCount").GetComponent<TextMeshProUGUI>(); |
|
|
|
} |
|
|
|
|
|
|
@ -35,7 +26,7 @@ public class GoodsEfcItem : GoodsItem |
|
|
|
Init(); |
|
|
|
imgIcon.sprite = AddressableMgr.GetIcon(itype, icode); |
|
|
|
|
|
|
|
SetActiveEffects(false); |
|
|
|
rarityEffectAnimator?.SetInteger(_rarityParam, 0); |
|
|
|
|
|
|
|
switch (itype) |
|
|
|
{ |
|
|
@ -70,15 +61,12 @@ public class GoodsEfcItem : GoodsItem |
|
|
|
case cGoods.TBagAcceRing: |
|
|
|
dGear gear = DataHandler.GetGearEquip(itype, icode); |
|
|
|
imgIcon.enabled = true; |
|
|
|
//imgBg.color = Global.CLR_RarityBack[gear.rarity];
|
|
|
|
//imgRarity.color = Global.CLR_RarityFront[gear.rarity];
|
|
|
|
imgRarity.enabled = true; |
|
|
|
for (int i = 0; i < imgStars.Length; i++) |
|
|
|
for (int i = 0; i < imgStars.Length; ++i) |
|
|
|
imgStars[i].enabled = i < gear.grade; |
|
|
|
txtRarity.text = Global.STR_Rarity[gear.rarity]; |
|
|
|
txtRarity.enabled = true; |
|
|
|
if (gear.rarity >= cGoods.RUnique) |
|
|
|
SetActiveEffects(true); |
|
|
|
rarityEffectAnimator?.SetInteger(_rarityParam, gear.rarity); |
|
|
|
|
|
|
|
if (icount == 1) |
|
|
|
{ |
|
|
@ -89,7 +77,7 @@ public class GoodsEfcItem : GoodsItem |
|
|
|
txtCount.enabled = true; |
|
|
|
txtCount.text = icount.ToString(); |
|
|
|
} |
|
|
|
imgBg.sprite = AddressableMgr.GetGradeIcon(gear.rarity);// Global.CLR_RarityBack[];
|
|
|
|
imgBg.sprite = AddressableMgr.GetGradeIcon(gear.rarity); |
|
|
|
imgRarity.sprite = AddressableMgr.GetGradeLatterIcon(gear.rarity); |
|
|
|
|
|
|
|
break; |
|
|
@ -232,8 +220,7 @@ public class GoodsEfcItem : GoodsItem |
|
|
|
imgStars[i].enabled = i < box.grade; |
|
|
|
txtRarity.text = Global.STR_Rarity[box.rarity]; |
|
|
|
txtRarity.enabled = true; |
|
|
|
if (box.rarity >= cGoods.RUnique) |
|
|
|
SetActiveEffects(true); |
|
|
|
rarityEffectAnimator?.SetInteger(_rarityParam, box.rarity); |
|
|
|
} |
|
|
|
|
|
|
|
if (icount == 1) |
|
|
@ -266,27 +253,8 @@ public class GoodsEfcItem : GoodsItem |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
if (bpvp) |
|
|
|
imgBg.color = Color.clear; |
|
|
|
} |
|
|
|
|
|
|
|
public void SetEffect(bool blarge) |
|
|
|
{ |
|
|
|
if(blarge) |
|
|
|
{ |
|
|
|
trfShineEffect.localScale = new UnityEngine.Vector3(1f, 1f, 1f); |
|
|
|
trfTopEffect.localScale = new UnityEngine.Vector3(100f, 100f, 1f); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
trfShineEffect.localScale = new UnityEngine.Vector3(0.7f, 0.7f, 1f); |
|
|
|
trfTopEffect.localScale = new UnityEngine.Vector3(70f, 70f, 1f); |
|
|
|
} |
|
|
|
} |
|
|
|
public void SetActiveEffects(bool bvalue) |
|
|
|
{ |
|
|
|
trfShineEffect.gameObject.SetActive(bvalue); |
|
|
|
trfTopEffect.gameObject.SetActive(bvalue); |
|
|
|
} |
|
|
|
|
|
|
|
} |