备份CatanBuilding瘦身独立工程
This commit is contained in:
35
Assets/Scripts/Duel/UI/PvpStoreItemSkin.cs
Normal file
35
Assets/Scripts/Duel/UI/PvpStoreItemSkin.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user