Files
back_cantanBuilding/Assets/Scripts/Duel/UI/PvpStoreItemSkin.cs
2026-05-26 16:15:54 +08:00

36 lines
1.0 KiB
C#

using asap.core;
using cfg;
using GameCore;
using UnityEngine;
public class PvpStoreItemSkin : PvpStoreItem
{
[SerializeField]
protected GameObject owned;
protected override void Init()
{
PlayerFishData playerFishData = GContext.container.Resolve<PlayerFishData>();
Item item = GContext.container.Resolve<Tables>().GetItemData(pvpStore.ItemId);
bool alreadyOwned = false;
if (item != null && item.Type == 3)
{
switch (item.SubType)
{
case 3:
alreadyOwned = playerFishData.IsSkinUnlocked(item.RedirectID);
break;
case 11:
alreadyOwned = playerFishData.IsGloveUnlocked(item.RedirectID);
break;
}
}
owned.SetActive(alreadyOwned);
btn_buy.gameObject.SetActive(!alreadyOwned);
}
protected override void BuyEnd()
{
owned.SetActive(true);
btn_buy.gameObject.SetActive(false);
}
}