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

59 lines
1.5 KiB
C#

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using GCGame.Table;
public class WelfarePageBaseCS : MonoBehaviour {
public int _NodeId;
public virtual void OnDisable()
{
if (WelfareRootCtr.Instance)
{
WelfareRootCtr.Instance.ClearShowWin(_NodeId);
}
}
public UIContainerBase _SubNodeContainer;
public List<Text> _DescLists;
public NodePageInfoRet _Packet;
public virtual void OnPacketRec(NodePageInfoRet packet)
{
_NodeId = packet._NodeId;
_Packet = packet;
InitDesc(packet._NodeDescList);
}
public void InitDesc(List<string> _StringList)
{
if(_StringList.Count <= 0)
{
if(_DescLists != null)
{
for (int index = 0; index < _DescLists.Count; index++)
{
_DescLists[index].gameObject.SetActive(false);
}
}
return;
}
for(int index = 0; index < _DescLists.Count && index < _StringList.Count; index++)
{
_DescLists[index].gameObject.SetActive(true);
_DescLists[index].text = StrDictionary.GetServerDictionaryFormatString(_StringList[index]);
}
if(_DescLists != null && _DescLists.Count > _StringList.Count)
{
for(int index = _StringList.Count; index < _DescLists.Count; index++)
{
_DescLists[index].gameObject.SetActive(false);
}
}
}
}