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

39 lines
870 B
C#

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
}