备份CatanBuilding瘦身独立工程
This commit is contained in:
38
Assets/Scripts/UI/Shop/EnergyShopPanel.cs
Normal file
38
Assets/Scripts/UI/Shop/EnergyShopPanel.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class EnergyShopPanel : MonoBehaviour
|
||||
{
|
||||
|
||||
#region Field&&Property
|
||||
[SerializeField]
|
||||
private EnergyShopSlot[] _diamondShopSlots;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Function
|
||||
private void Awake()
|
||||
{
|
||||
var shopTokens = GContext.container.Resolve<Tables>().TbResourceStore.DataList;
|
||||
var energyShopTokens = shopTokens.Where(x => x.ItemID== 1001).ToArray();
|
||||
|
||||
for ( int i = 0; i < energyShopTokens.Length; i++ )
|
||||
{
|
||||
if ( i == _diamondShopSlots.Length )
|
||||
{
|
||||
Debug.LogError($"[EnergyShopPanel::Awake]Energy Shop Slot Not Enough");
|
||||
break;
|
||||
}
|
||||
_diamondShopSlots[i].SetData(energyShopTokens[i]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user