2023-10-19 15:00:19 +08:00
|
|
|
|
using cfg.CharacterCfg;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Framework;
|
|
|
|
|
|
using Gameplay.Common;
|
|
|
|
|
|
using Gameplay.Net;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using NLDPB;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using System;
|
2023-11-30 16:18:57 +08:00
|
|
|
|
using System.Numerics;
|
2023-12-05 12:49:29 +08:00
|
|
|
|
using Gameplay;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using TMPro;
|
2023-11-30 16:18:57 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.EventSystems;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Button = UnityEngine.UI.Button;
|
|
|
|
|
|
using Image = UnityEngine.UI.Image;
|
2023-11-30 16:18:57 +08:00
|
|
|
|
using Vector3 = UnityEngine.Vector3;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
public class UILevelUpController : UIWindow
|
|
|
|
|
|
{
|
|
|
|
|
|
//UI GameObj
|
|
|
|
|
|
///Auto Gen Start///
|
|
|
|
|
|
public Image Image_BG;
|
|
|
|
|
|
public Button Button_Back;
|
|
|
|
|
|
public TMP_Text Text_Back;
|
|
|
|
|
|
public Button Button_Home;
|
|
|
|
|
|
public Image Image_PointBG;
|
|
|
|
|
|
public TMP_Text Text_ExpPoint;
|
|
|
|
|
|
public TMP_Text Text_UniversalExp;
|
|
|
|
|
|
public TMP_Text Text_Exp_Value;
|
|
|
|
|
|
public Image Image_LevelUPBar;
|
|
|
|
|
|
public Image Image_Poster;
|
|
|
|
|
|
public TMP_Text Text_Level_Now;
|
|
|
|
|
|
public TMP_Text Text_Level_Max;
|
|
|
|
|
|
public Image Image_Hp;
|
|
|
|
|
|
public TMP_Text Text_Hp;
|
|
|
|
|
|
public TMP_Text Text_Hp_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Hp;
|
|
|
|
|
|
public Image Image_Morale;
|
|
|
|
|
|
public TMP_Text Text_Cultivate_Morale;
|
|
|
|
|
|
public TMP_Text Text_Morale_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Morale;
|
|
|
|
|
|
public Image Image_Defense;
|
|
|
|
|
|
public TMP_Text Text_Cultivate_Defense;
|
|
|
|
|
|
public TMP_Text Text_Defense_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Defanse;
|
|
|
|
|
|
public Image Image_Armor;
|
|
|
|
|
|
public TMP_Text Text_Cultivate_Armor;
|
|
|
|
|
|
public TMP_Text Text_Armor_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Armor;
|
|
|
|
|
|
public Image Image_Attack;
|
|
|
|
|
|
public TMP_Text Text_Cultivate_Attack;
|
|
|
|
|
|
public TMP_Text Text_Attack_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Attack;
|
|
|
|
|
|
public Image Image_Speed;
|
|
|
|
|
|
public TMP_Text Text_Cultivate_Speed;
|
|
|
|
|
|
public TMP_Text Text_Speed_Value;
|
|
|
|
|
|
public TMP_Text Text_Change_Speed;
|
|
|
|
|
|
public TMP_Text Text_ExpBefore;
|
|
|
|
|
|
public TMP_Text Text_EXP;
|
|
|
|
|
|
public TMP_Text Text_Plus;
|
|
|
|
|
|
public TMP_Text Text_ExpNeed;
|
|
|
|
|
|
public TMP_Text Text_Level_Value;
|
|
|
|
|
|
public TMP_Text Text_LV;
|
|
|
|
|
|
public TMP_Text Text_LevelUpTo;
|
|
|
|
|
|
public Button Button_MAX;
|
|
|
|
|
|
public Button Button_Plus;
|
|
|
|
|
|
public Button Button_Minus;
|
|
|
|
|
|
public Image Image_LevelBar;
|
|
|
|
|
|
public Image Image_LevelArrow;
|
|
|
|
|
|
public TMP_Text Text_Level;
|
|
|
|
|
|
public Button Button_Cannot;
|
|
|
|
|
|
public TMP_Text Text_Cannot_Confirm;
|
|
|
|
|
|
public Button Button_Confirm;
|
|
|
|
|
|
public TMP_Text Text_Confirm;
|
|
|
|
|
|
public Button Button_Cancel;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private int expLast;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CharacterDataInfo mCharacterDataInfo;
|
|
|
|
|
|
private int mCurrentExp;
|
|
|
|
|
|
CharacterLevelExp mCharacterLevelExpCfg;
|
|
|
|
|
|
CharacterBreak mCharacterBreak;
|
|
|
|
|
|
///Auto Gen End/// <summary>
|
|
|
|
|
|
/// Auto Gen End///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
int targetLevel ;
|
|
|
|
|
|
|
2023-11-30 16:18:57 +08:00
|
|
|
|
public DragForUI dragForUI;
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
// Use this for initialization
|
|
|
|
|
|
public override void OnAwake()
|
|
|
|
|
|
{
|
|
|
|
|
|
//bind UI GameObj
|
|
|
|
|
|
UILevelUpBinder.GetComponents(this);
|
|
|
|
|
|
BindButton(Button_Back, OnButton_BackClick);
|
|
|
|
|
|
BindButton(Button_Plus, OnButton_PlusClick);
|
|
|
|
|
|
BindButton(Button_Minus, OnButton_MinusClick);
|
|
|
|
|
|
BindButton(Button_MAX, OnButton_MAXClick);
|
|
|
|
|
|
BindButton(Button_Cancel, OnButton_CancelClick);
|
|
|
|
|
|
BindButton(Button_Confirm, OnButton_ConfirmClick);
|
2023-11-21 15:18:32 +08:00
|
|
|
|
BindButton(Button_Home, OnClickHome);
|
2023-12-05 12:49:29 +08:00
|
|
|
|
dragForUI = CommonUtils.GetComponent<DragForUI>(this.gameObject,"Drag");
|
2023-11-30 16:18:57 +08:00
|
|
|
|
dragForUI.OnDragStarted += ondragStart;
|
|
|
|
|
|
dragForUI.OnDraging += ondrag;
|
|
|
|
|
|
dragForUI.OnDragCompleted += ondragend;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UnityEngine.Vector2 startPos;
|
|
|
|
|
|
private void ondragend(PointerEventData eventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ondrag(PointerEventData eventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
float offset = eventData.position.y - startPos.y;
|
|
|
|
|
|
if (offset < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (targetLevel <= mCharacterDataInfo.Level)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
targetLevel--;
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
}else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel) == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("没有配置Id {0} 突破等级 {1}", mCharacterDataInfo.ID, mCharacterDataInfo.BreakLevel);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (targetLevel >= mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel).LevelLimit)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
targetLevel++;
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ondragStart(PointerEventData eventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
startPos = eventData.position;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2023-11-21 15:18:32 +08:00
|
|
|
|
}
|
2023-11-30 16:18:57 +08:00
|
|
|
|
|
|
|
|
|
|
|
2023-11-21 15:18:32 +08:00
|
|
|
|
private void OnClickHome()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIManager.Instance.CloseAllNormalExcept(UINameConst.UI_MainPanel);
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private void RegisterEvent()
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.EN_CharacterLevelUp,(Action<UpgradeType>)OnCharacterLevelup);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
private void OnCharacterLevelup(UpgradeType type)
|
|
|
|
|
|
{
|
|
|
|
|
|
if(type!=UpgradeType.UtLevel)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
mCharacterDataInfo = CharacterDataInfoManager.Instance.GetCharacterInfo(mCharacterDataInfo.ID);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
targetLevel = (int)mCharacterDataInfo.Level;
|
|
|
|
|
|
RefreshUI();
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
private void UnregisterEvent()
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.EN_CharacterLevelUp,(Action<UpgradeType>)OnCharacterLevelup);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
private void RefreshLevelUpBtn()
|
|
|
|
|
|
{
|
|
|
|
|
|
Button_Cannot.gameObject.SetActive(targetLevel == mCharacterDataInfo.Level);
|
|
|
|
|
|
Button_Confirm.gameObject.SetActive(targetLevel != mCharacterDataInfo.Level);
|
|
|
|
|
|
Button_Cancel.gameObject.SetActive(targetLevel != mCharacterDataInfo.Level);
|
|
|
|
|
|
}
|
|
|
|
|
|
private void OnButton_ConfirmClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(targetLevel==mCharacterDataInfo.Level)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (targetLevel >= expLast)
|
|
|
|
|
|
{
|
2023-12-21 15:59:18 +08:00
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("cultivate_expDontFull"));
|
2023-10-19 15:00:19 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (Actor.Instance.Item.GetItemCount(GLConfig.Inst.data.HeroExpItem)< expLast)
|
2023-12-21 15:59:18 +08:00
|
|
|
|
{
|
|
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("cultivate_expDontFull"));
|
2023-10-19 15:00:19 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
NetHelper.CharacterUpgrade(mCharacterDataInfo.ID,NLDPB.UpgradeType.UtLevel,(uint)targetLevel);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnButton_CancelClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(targetLevel==mCharacterDataInfo.Level)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
targetLevel = (int)mCharacterDataInfo.Level;
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private void OnButton_MAXClick()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
if (targetLevel > mCharacterDataInfo.Cfg.Hp.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("levelexp表和各种属性没有该突破等级的等级限制等级");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
if (targetLevel >= mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel).LevelLimit)
|
|
|
|
|
|
{
|
2023-12-21 15:59:18 +08:00
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("cultivate_LevelUpMAX"));
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
targetLevel = mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel).LevelLimit;
|
|
|
|
|
|
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnButton_MinusClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (targetLevel <= mCharacterDataInfo.Level)
|
|
|
|
|
|
{
|
2023-12-21 15:59:18 +08:00
|
|
|
|
CommonUtils.ShowMessageTips("cultivate_LevelUpMIN");
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
targetLevel--;
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnButton_PlusClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
if(mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel)==null)
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
DebugUtil.LogError("没有配置Id {0} 突破等级 {1}",mCharacterDataInfo.ID, mCharacterDataInfo.BreakLevel);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(targetLevel>= mCharacterBreak.Get((int)mCharacterDataInfo.ID,(int)mCharacterDataInfo.BreakLevel).LevelLimit)
|
|
|
|
|
|
{
|
2023-12-21 15:59:18 +08:00
|
|
|
|
CommonUtils.ShowMessageTips(CommonUtils.GetLocalizeText("cultivate_LevelUpMAX"));
|
2023-10-19 15:00:19 +08:00
|
|
|
|
return;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
targetLevel++;
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnButton_BackClick()
|
|
|
|
|
|
{
|
|
|
|
|
|
CloseWindow();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void LoadCfg()
|
|
|
|
|
|
{
|
|
|
|
|
|
OnLoadCfg(TableManager.Instance.Tables.CharacterLevelExp);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnLoadCfg(CharacterLevelExp characterLevelExp)
|
|
|
|
|
|
{
|
|
|
|
|
|
mCharacterLevelExpCfg=characterLevelExp;
|
|
|
|
|
|
mCharacterBreak = TableManager.Instance.Tables.CharacterBreak;
|
|
|
|
|
|
RefreshUI();
|
|
|
|
|
|
RefreshAfterChangeValue();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//invoke when open window
|
|
|
|
|
|
protected override void OnOpenWindow(object data = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
mCharacterDataInfo = data as CharacterDataInfo;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
if (mCharacterDataInfo != null) targetLevel = (int)mCharacterDataInfo.Level;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
LoadCfg();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
expLast = 0;
|
2023-12-05 12:49:29 +08:00
|
|
|
|
CommonUtils.SetImageBlur(GetComponent<Image>("blurObj"));
|
2023-10-19 15:00:19 +08:00
|
|
|
|
InputManager.Instance.OnFingersMove += OnFingersHover;
|
2023-11-20 19:46:52 +08:00
|
|
|
|
RegisterEvent();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OnFingersHover(float delta)
|
|
|
|
|
|
{
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void RefreshUI()
|
|
|
|
|
|
{
|
2023-12-05 12:49:29 +08:00
|
|
|
|
CommonUtils.RefreshCharacter2DPic(Image_Poster,mCharacterDataInfo.Cfg.RoleID, CommonUtils.ECharacterPicPathType.LevelUp);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
RefresLevelUpBar(mCharacterDataInfo.Level);
|
|
|
|
|
|
RefreshLevelUpBtn();
|
|
|
|
|
|
}
|
2023-10-19 15:00:19 +08:00
|
|
|
|
private void RefresLevelUpBar(uint targetRefreshLevel)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
uint nowLevel =targetRefreshLevel;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
int maxLevel = (int)mCharacterBreak.Get((int)mCharacterDataInfo.ID, (int)mCharacterDataInfo.BreakLevel).LevelLimit;
|
|
|
|
|
|
|
|
|
|
|
|
Text_Level_Now.text = nowLevel.ToString();
|
|
|
|
|
|
Text_Level_Max.text ="/" +maxLevel.ToString();
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
Text_Level_Value.text = targetRefreshLevel.ToString();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text_Hp_Value.text = mCharacterDataInfo.HP().ToString();
|
|
|
|
|
|
Text_Morale_Value.text = mCharacterDataInfo.Cfg.MaxMorale.ToString();
|
|
|
|
|
|
Text_Defense_Value.text = mCharacterDataInfo.Defence().ToString();
|
|
|
|
|
|
Text_Armor_Value.text= mCharacterDataInfo.Armor().ToString();
|
|
|
|
|
|
Text_Attack_Value.text=mCharacterDataInfo.Attack().ToString();
|
|
|
|
|
|
Text_Speed_Value.text=mCharacterDataInfo.MoveSpeed().ToString();
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
Text_Exp_Value.text = Actor.Instance.Item.GetItemCount(GLConfig.Inst.data.HeroExpItem).ToString(); ;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
private void RefreshAfterChangeValue()
|
|
|
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
|
float changeHp = mCharacterDataInfo.HpLevelUp((int)targetLevel) - mCharacterDataInfo.HpLevelUp((int)mCharacterDataInfo.Level);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
float changeMorale = 0;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
float changeDefense = mCharacterDataInfo.DefenceLevelUp((int)targetLevel)- mCharacterDataInfo.DefenceLevelUp((int)mCharacterDataInfo.Level);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
float changeArmor = 0;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
float changeAttack = mCharacterDataInfo.AttackLevelUp((int)targetLevel) - mCharacterDataInfo.AttackLevelUp((int)mCharacterDataInfo.Level);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
float changespeed = 0;
|
|
|
|
|
|
|
|
|
|
|
|
Text_Change_Hp.gameObject.SetActive(changeHp != 0);
|
|
|
|
|
|
Text_Change_Hp.text ="+"+ changeHp.ToString();
|
|
|
|
|
|
Text_Change_Morale.gameObject.SetActive(changeMorale != 0);
|
|
|
|
|
|
Text_Change_Morale.text = "+" + changeMorale.ToString();
|
|
|
|
|
|
Text_Change_Defanse.gameObject.SetActive(changeDefense != 0);
|
|
|
|
|
|
Text_Change_Defanse.text = "+" + changeDefense.ToString();
|
|
|
|
|
|
Text_Change_Armor.gameObject.SetActive(changeArmor != 0);
|
|
|
|
|
|
Text_Change_Armor.text = "+" + changeArmor.ToString();
|
|
|
|
|
|
Text_Change_Attack.gameObject.SetActive(changeAttack != 0);
|
|
|
|
|
|
Text_Change_Attack.text = "+" + changeAttack.ToString();
|
|
|
|
|
|
Text_Change_Speed.gameObject.SetActive(changespeed != 0);
|
|
|
|
|
|
Text_Change_Speed.text = "+" + changespeed.ToString();
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
expLast=0;
|
2023-11-15 19:50:48 +08:00
|
|
|
|
for (int i = (int)mCharacterDataInfo.Level; i < targetLevel; i++)
|
2023-10-19 15:00:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (mCharacterLevelExpCfg.GetOrDefault((i + 1)) != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
expLast += mCharacterLevelExpCfg.GetOrDefault((i + 1)).EXP;
|
|
|
|
|
|
}else
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError("CharacterLevelExpCfg的等级不够了!!!");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
Text_ExpNeed.gameObject.SetActive(expLast != 0);
|
|
|
|
|
|
Text_ExpNeed.text = expLast.ToString();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
Text_Level_Now.text = targetLevel.ToString();
|
2023-11-16 14:01:01 +08:00
|
|
|
|
Text_ExpBefore.text = mCharacterDataInfo.Exp.ToString();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//invoke when reload window
|
|
|
|
|
|
protected override void OnReloadWindow(object data = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//invoke when close window
|
2023-11-21 13:31:06 +08:00
|
|
|
|
protected override void OnCloseWindow()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
UnregisterEvent();
|
2023-10-19 15:00:19 +08:00
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.EN_UIControllCultivateMainInput, true);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|