Files
JJBB/Assets/Project/Script/GUI/BackPack/OrnamentAttrPanel.cs
2024-08-23 15:49:34 +08:00

43 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GCGame.Table;
using UnityEngine.UI;
public class OrnamentAttrPanel : MonoBehaviour {
public static OrnamentAttrPanel Instance;
private void Awake()
{
Instance = this;
if (OrnamentPanel.Instance)
InitAttr(OrnamentPanel.Instance.SelectOrnamentTab);
}
private void OnDestroy()
{
Instance = null;
}
public Text _CombatVal;
public GameObject _AttrObj;
public Transform _AttrParent;
public List<OrnamentAttr> attrList = new List<OrnamentAttr>();
public void InitAttr(Tab_Ornament ornamentTab)
{
for(int index = 0; index < ornamentTab.getPropIdCount(); index++)
{
attrList[index].InitProp(ornamentTab.GetPropIdbyIndex(index), ornamentTab.GetPropValbyIndex(index));
}
for(int index = ornamentTab.getPropIdCount(); index < attrList.Count; index++)
{
attrList[index].InitProp(-1, -1);
}
_CombatVal.text = ornamentTab.CombatVal + "";
}
}