using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using LitJson;
|
|
namespace vnxbqy.UI
|
{
|
public class RealmBriefBehaviour : MonoBehaviour
|
{
|
[SerializeField] Image nowRealmImg;
|
[SerializeField] Image nextRealmImg;
|
[SerializeField] Text nowLVLimitText;
|
[SerializeField] Text nextLVLimitText;
|
[SerializeField] List<Text> m_Properties;
|
[SerializeField] List<Text> m_NextProperties;
|
[SerializeField] Text unLockEffect; //境界解锁效果:技能,装备,灵根等
|
[SerializeField] Button unLockEffectBtn;
|
[SerializeField] Button unLockEffectShowAllBtn;
|
[SerializeField] UIEffect unlockUIEffect;
|
[SerializeField] List<RealmMissionCell> missionObjs;
|
|
|
|
public void Display()
|
{
|
var config = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel);
|
var nextConfig = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel + 1);
|
nextConfig = nextConfig == null ? config : nextConfig;
|
nowRealmImg.SetSprite(config.Img);
|
nextRealmImg.SetSprite(nextConfig.Img);
|
nowLVLimitText.text = Language.Get("LoadIconLV", config.LVMax);
|
nextLVLimitText.text = Language.Get("LoadIconLV", nextConfig.LVMax);
|
|
for (int i = 0; i < m_Properties.Count; i++)
|
{
|
if (config.AddAttrType.Length > i)
|
{
|
m_Properties[i].text = PlayerPropertyConfig.GetFullDescription(config.AddAttrType[i], config.AddAttrNum[i]);
|
}
|
else
|
{
|
m_Properties[i].text = "";
|
}
|
}
|
|
for (int i = 0; i < m_NextProperties.Count; i++)
|
{
|
if (nextConfig.AddAttrType.Length > i)
|
{
|
m_NextProperties[i].text = PlayerPropertyConfig.GetFullDescription(nextConfig.AddAttrType[i], nextConfig.AddAttrNum[i]);
|
}
|
else
|
{
|
m_NextProperties[i].text = "";
|
}
|
}
|
|
unlockUIEffect.Stop();
|
|
if (nextConfig.LearnSkillIDInfo.Count > 0)
|
{
|
var skillID = nextConfig.LearnSkillIDInfo[PlayerDatas.Instance.baseData.Job][0];
|
var skillConfig = SkillConfig.Get(skillID);
|
unLockEffect.text = Language.Get("RealmUnLockSkill", skillConfig.SkillName);
|
unLockEffectBtn.SetListener(() => {
|
SkillDetails.ShowSkillDetails(skillID, SkillDetails.SkillSourceType.PlayerSkill, skillConfig.FightPower);
|
});
|
}
|
else if (nextConfig.AddFreePoint > 0)
|
{
|
unLockEffect.text = Language.Get("RealmUnLockLG", nextConfig.AddFreePoint);
|
unLockEffectBtn.RemoveAllListeners();
|
}
|
else if (nextConfig.EquipLV > 0)
|
{
|
unLockEffect.text = Language.Get("RealmUnLockEquip", Language.Get("RealmEquipName", nextConfig.NameEx));
|
unLockEffectBtn.SetListener(() =>
|
{
|
WindowCenter.Instance.Open<RealmEquipPreviewWin>(false, nextConfig.EquipLV);
|
});
|
unlockUIEffect.Play();
|
}
|
else
|
{
|
unLockEffect.text = "";
|
unLockEffectBtn.SetActive(false);
|
unLockEffectBtn.RemoveAllListeners();
|
}
|
|
unLockEffectShowAllBtn.AddListener(() =>
|
{
|
WindowCenter.Instance.Open<RealmUnlockEffectWin>();
|
}
|
);
|
|
var missions = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
|
for (int i = 0; i < missionObjs.Count; i++)
|
{
|
missionObjs[i].Display(missions[i]);
|
}
|
|
}
|
|
|
}
|
}
|
|