Files
JJBB/Assets/Project/Script/GUI/Childs/ChildSkillLevelLimitDesc.cs

59 lines
2.0 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using GCGame.Table;
public class ChildSkillLevelLimitDesc : MonoBehaviour {
public Text _CurSkillDesc;
public GameObject _NextSkillLeveliLimitObj;
public Text _CurSkillLimitLevel;
public Text _NextSkillLimitLevel;
//当前标记位技能Index
public int _SkillIndex;
private int _CurSelectChildIndex = 0;
public void InitSkillLimitDesc(int _ChildIndex)
{
_CurSelectChildIndex = _ChildIndex;
gameObject.SetActive(true);
var childLevel = ChildData.GetChildByIndex(_CurSelectChildIndex).basic.curLevel;
var childrenLevelUpTab = TableManager.GetChildrenLevelUpByID(childLevel, 0);
if(childrenLevelUpTab == null)
{
gameObject.SetActive(false);
Debug.LogError("ChildrenLevelUp is null : " + childLevel);
return;
}
var childStateTypeTab = TableManager.GetChildrenStateTypeByID(childrenLevelUpTab.CurStateType);
if(childStateTypeTab == null)
{
gameObject.SetActive(false);
Debug.LogError("childStateTypeTab is null : " + childrenLevelUpTab.CurStateType);
return;
}
//当前阶段技能最高等级
_CurSkillLimitLevel.text = childStateTypeTab.GetSkillLevelMaxbyIndex(_SkillIndex) + "";
var nextChildStateTypeTab = ChildRenicarNationPanel.Instance.GetNextGradeStateTypeTab(childrenLevelUpTab.CurStateType);
//下个阶段最高等级
if (nextChildStateTypeTab == null)
{
_NextSkillLeveliLimitObj.SetActive(false);
}
else
{
_NextSkillLimitLevel.text = nextChildStateTypeTab.GetSkillLevelMaxbyIndex(_SkillIndex) + "";
}
var childrenSkillParamTab = ChildData.GetSkillPatamTabByType(_SkillIndex + 1);
if (childrenSkillParamTab != null)
_CurSkillDesc.text = StrDictionary.GetClientDictionaryString("#{86809}", childrenSkillParamTab.SkillName);
}
}