2024-01-17 12:57:07 +08:00
|
|
|
|
using System.Collections.Generic;
|
2024-04-24 14:31:42 +08:00
|
|
|
|
using System.Linq;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
using cfg.CharacterCfg;
|
2024-05-20 12:51:49 +08:00
|
|
|
|
using cfg.LevelCfg;
|
2024-04-02 15:21:30 +08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
using Framework;
|
|
|
|
|
|
using Gameplay;
|
|
|
|
|
|
using Gameplay.Character;
|
2024-07-05 21:26:37 +08:00
|
|
|
|
using Gameplay.Guide;
|
2023-10-19 15:00:19 +08:00
|
|
|
|
using Gameplay.Level;
|
|
|
|
|
|
using Gameplay.Net;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
using Gameplay.Unit;
|
|
|
|
|
|
using NLDPB;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using TMPro;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
using UnityEngine;
|
2024-04-02 15:21:30 +08:00
|
|
|
|
using UnityEngine.UI;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
using Image = UnityEngine.UI.Image;
|
2024-07-10 17:09:11 +08:00
|
|
|
|
using DG.Tweening;
|
2024-08-23 19:53:32 +08:00
|
|
|
|
using Gameplay.Effect;
|
2024-09-20 18:33:26 +08:00
|
|
|
|
using System;
|
2024-09-26 19:25:46 +08:00
|
|
|
|
using Gameplay.Common;
|
2024-09-20 19:35:03 +08:00
|
|
|
|
using PhxhSDK;
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
public class UIPassGameController : UIWindow
|
|
|
|
|
|
{
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
//UI GameObj
|
2024-01-12 16:04:49 +08:00
|
|
|
|
///Auto Gen Start///
|
|
|
|
|
|
public Image Image_WinBG;
|
|
|
|
|
|
public Image Image_PosterLu;
|
|
|
|
|
|
public Image Image_TextRect;
|
|
|
|
|
|
public TMP_Text Text_Win;
|
|
|
|
|
|
public Image Image_BlueBar;
|
|
|
|
|
|
public TMP_Text Text_LevelNum;
|
|
|
|
|
|
public TMP_Text Text_LevelName;
|
|
|
|
|
|
public TMP_Text Text_FightTime;
|
|
|
|
|
|
public Image Image_Clock;
|
|
|
|
|
|
public TMP_Text Text_Time;
|
|
|
|
|
|
public TMP_Text Text_CharacterID;
|
|
|
|
|
|
public TMP_Text Text_CharacterLV;
|
|
|
|
|
|
public Image Image_EXEmpty;
|
|
|
|
|
|
public Image Image_EXFull;
|
|
|
|
|
|
public TMP_Text Text_EX;
|
|
|
|
|
|
public TMP_Text Text_LVUp;
|
|
|
|
|
|
public TMP_Text Text_Target;
|
|
|
|
|
|
public Image Image_DownShadow;
|
|
|
|
|
|
public TMP_Text Text_GeneralEX;
|
|
|
|
|
|
public Image Image_ELogo;
|
|
|
|
|
|
public TMP_Text Text_EXPHave;
|
|
|
|
|
|
public TMP_Text Text_EXPGet;
|
2024-08-05 20:05:12 +08:00
|
|
|
|
public TMP_Text Text_Mode;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
2024-01-12 16:04:49 +08:00
|
|
|
|
///Auto Gen End///
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
2024-09-26 19:25:46 +08:00
|
|
|
|
private static bool _isPvPSuccess;
|
2024-09-20 18:33:26 +08:00
|
|
|
|
public static async UniTask<UIWindow> Open(ItemList itemList, bool isSweep)
|
2024-05-06 15:35:03 +08:00
|
|
|
|
{
|
2024-09-20 18:33:26 +08:00
|
|
|
|
ValueTuple<ItemList, bool> value = (itemList, isSweep);
|
|
|
|
|
|
|
|
|
|
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UIPassGame, value);
|
2024-04-02 15:21:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-26 19:25:46 +08:00
|
|
|
|
public static async UniTask<UIWindow> PvPOpen(ItemList itemList, bool isSuccess)
|
|
|
|
|
|
{
|
|
|
|
|
|
ValueTuple<ItemList, bool> value = (itemList, false);
|
|
|
|
|
|
|
|
|
|
|
|
_isPvPSuccess = isSuccess;
|
|
|
|
|
|
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UIPassGame, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-02 15:21:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 高斯模糊遮罩
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private RawImage rawImageGaussianBlurMask;
|
2024-04-28 17:01:49 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 台词文本
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private TMP_Text textDialogue;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 角色名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private TMP_Text textName;
|
2024-04-02 15:21:30 +08:00
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
private List<Image> _imgWinStar;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
|
|
|
|
|
private List<Image> _imageFailedStart;
|
|
|
|
|
|
|
|
|
|
|
|
private List<GameObject> _aimObjList;
|
|
|
|
|
|
|
|
|
|
|
|
private int _levelID;
|
|
|
|
|
|
|
|
|
|
|
|
private List<GameObject> _itemHeadList;
|
|
|
|
|
|
|
|
|
|
|
|
private List<uint> _charIDs;
|
2024-01-17 18:53:40 +08:00
|
|
|
|
|
|
|
|
|
|
private ItemList _itemList;
|
2024-09-20 18:33:26 +08:00
|
|
|
|
private bool isSweep;
|
2024-09-25 15:40:50 +08:00
|
|
|
|
private bool _isNormal;
|
|
|
|
|
|
private bool _isWar;
|
2024-09-26 14:46:49 +08:00
|
|
|
|
private bool _isPvP;
|
2024-09-26 19:25:46 +08:00
|
|
|
|
|
|
|
|
|
|
private Sequence _seqPvp;
|
|
|
|
|
|
private bool _isPlaying;
|
|
|
|
|
|
private PVPSettleData _settleData;
|
|
|
|
|
|
private PVPSettleData _newPVPData;
|
2024-09-25 15:40:50 +08:00
|
|
|
|
|
|
|
|
|
|
private GameObject _goCharDetail;
|
|
|
|
|
|
private GameObject _goMissionDetail;
|
2024-09-26 14:46:49 +08:00
|
|
|
|
private GameObject _goPvPDetail;
|
2024-09-25 15:40:50 +08:00
|
|
|
|
private GameObject _goWarDetail;
|
|
|
|
|
|
private RecycleView _scrollWar;
|
2024-04-28 17:01:49 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 台词语音
|
|
|
|
|
|
/// </summary>
|
2024-07-22 19:59:13 +08:00
|
|
|
|
private AudioInst dialogueAudio;
|
2024-01-25 17:52:04 +08:00
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否正在播放台词语音
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsDialoguePlaying
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return dialogueAudio != null && dialogueAudio.IsPlaying; }
|
|
|
|
|
|
}
|
2024-04-28 17:01:49 +08:00
|
|
|
|
|
2024-07-10 17:09:11 +08:00
|
|
|
|
private bool _isPlayingAnim; //是否正在播放升级动画
|
|
|
|
|
|
private int _playerLvUp; //获取到的升级
|
|
|
|
|
|
private float _playerExpUp; //需要最后涨的经验值
|
|
|
|
|
|
private Sequence _seq;
|
2024-10-18 14:04:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 临时处理,保证只添加过一次升级动画
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private bool isAddUpAnim;
|
2024-07-10 17:09:11 +08:00
|
|
|
|
|
2024-09-20 19:35:03 +08:00
|
|
|
|
public override async void PreLoad(object data = null)
|
2024-01-25 17:52:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
base.PreLoad(data);
|
2024-09-20 18:33:26 +08:00
|
|
|
|
|
|
|
|
|
|
if (data is ValueTuple<ItemList, bool> value)
|
2024-01-25 17:52:04 +08:00
|
|
|
|
{
|
2024-09-20 18:33:26 +08:00
|
|
|
|
_itemList = value.Item1;
|
|
|
|
|
|
isSweep = value.Item2;
|
|
|
|
|
|
|
2024-09-20 19:35:03 +08:00
|
|
|
|
if (isSweep)
|
|
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
Team team = LevelManager.Instance.SettleData.Team;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
var teamCharacterIDs = team.GetAllCharacters();
|
|
|
|
|
|
for (int i = 0; i < teamCharacterIDs.Count; i++)
|
2024-09-20 19:35:03 +08:00
|
|
|
|
{
|
|
|
|
|
|
uint uid = teamCharacterIDs[i];
|
2024-10-22 20:04:00 +08:00
|
|
|
|
// 空位置不显示
|
|
|
|
|
|
if (uid == Team.NoneID) continue;
|
2024-09-20 19:35:03 +08:00
|
|
|
|
DataCharacterAttri cfg = TableManager.Instance.Tables.CharacterAttri.Get((int)uid);
|
|
|
|
|
|
if (null != cfg)
|
|
|
|
|
|
{
|
2024-10-23 15:08:29 +08:00
|
|
|
|
//TeamManager 内已经加载过头像,这里不需要再加载
|
2024-10-23 16:09:09 +08:00
|
|
|
|
var config = CharacterDataInfoManager.Instance.GetCharacterInfo((uint)cfg.RoleID);
|
|
|
|
|
|
string str = CommonUtils.GetCharacterPicPath(cfg.RoleID, CommonUtils.ECharacterPicPathType.HeadPic, (int)config.SkinID);//CommonUtils.GetDefaultHeadPathByUid((uint)cfg.RoleID);
|
2024-09-20 19:35:03 +08:00
|
|
|
|
string posterStr = CommonUtils.GetCharacterPicPath(cfg.RoleID, CommonUtils.ECharacterPicPathType.Poster);
|
2024-10-23 16:09:09 +08:00
|
|
|
|
await PostPreload<Sprite>(str);
|
2024-09-20 19:35:03 +08:00
|
|
|
|
await PostPreload<Sprite>(posterStr);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-09-25 15:40:50 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2024-09-26 19:25:46 +08:00
|
|
|
|
if (LevelManager.Instance.CurrentLevel.IsPvPLevel)
|
|
|
|
|
|
{
|
|
|
|
|
|
_isPvP = true;
|
|
|
|
|
|
_settleData = LevelManager.Instance.PvpSettleData;
|
|
|
|
|
|
_newPVPData = new PVPSettleData();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-09-25 15:40:50 +08:00
|
|
|
|
_isWar = LevelManager.Instance.CurrentLevel.IsWar;
|
|
|
|
|
|
}
|
2024-09-20 18:33:26 +08:00
|
|
|
|
}
|
2024-01-25 17:52:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
// Use this for initialization
|
2024-01-23 12:25:47 +08:00
|
|
|
|
public override void OnInit()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
//bind UI GameObj
|
2024-01-12 16:04:49 +08:00
|
|
|
|
UIPassGameBinder.GetComponents(this);
|
2024-04-02 15:21:30 +08:00
|
|
|
|
|
2024-08-05 20:05:12 +08:00
|
|
|
|
Text_Mode = GetComponent<TMP_Text>("Image_WinBG/Text_Win/Text_Mode");
|
2024-05-06 15:35:03 +08:00
|
|
|
|
textName = GetComponent<TMP_Text>("Image_WinBG/Image_PosterLu/Image_ActorLineBG/Text_Name");
|
|
|
|
|
|
textDialogue = GetComponent<TMP_Text>("Image_WinBG/Image_PosterLu/Image_ActorLineBG/Text_Describe");
|
2024-10-17 17:21:15 +08:00
|
|
|
|
//rawImageGaussianBlurMask = GetComponent<RawImage>("GaussianBlurMask");
|
2024-09-25 15:40:50 +08:00
|
|
|
|
|
2024-04-02 15:21:30 +08:00
|
|
|
|
|
2024-10-17 17:21:15 +08:00
|
|
|
|
//rawImageGaussianBlurMask.texture = CommonUtils.GetScreenTexture2D();
|
2024-09-25 15:40:50 +08:00
|
|
|
|
_goCharDetail = FindObj("Image_WinBG/CharacterDetail");
|
|
|
|
|
|
_goMissionDetail = FindObj("Image_WinBG/MissionDetail");
|
|
|
|
|
|
_goWarDetail = FindObj("Image_WinBG/UI_WarLevel");
|
2024-09-26 14:46:49 +08:00
|
|
|
|
_goPvPDetail = FindObj("Image_WinBG/UI_PVP");
|
2024-09-25 15:40:50 +08:00
|
|
|
|
_scrollWar = GetComponent<RecycleView>("Image_WinBG/UI_WarLevel/Image_WarTarget/ScrollViewTarget");
|
2024-04-02 15:21:30 +08:00
|
|
|
|
|
2024-09-26 15:08:23 +08:00
|
|
|
|
BindButton("Button_Close", _OnClickClose);
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_imgWinStar = new List<Image>();
|
|
|
|
|
|
_imageFailedStart = new List<Image>();
|
|
|
|
|
|
_aimObjList = new List<GameObject>();
|
|
|
|
|
|
_itemHeadList = new List<GameObject>();
|
|
|
|
|
|
_charIDs = new List<uint>();
|
|
|
|
|
|
for (int i = 0; i < 3; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var img = GetComponent<Image>("Image_WinBG/MissionDetail/ImageMissionBar" + i + "/ImageWinStart");
|
|
|
|
|
|
var imgFail = GetComponent<Image>("Image_WinBG/MissionDetail/ImageMissionBar" + i + "/ImageFailedStart");
|
|
|
|
|
|
_imgWinStar.Add(img);
|
|
|
|
|
|
_imageFailedStart.Add(imgFail);
|
|
|
|
|
|
|
|
|
|
|
|
_aimObjList.Add(FindObj("Image_WinBG/MissionDetail/ImageMissionBar" + i));
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
for (int i = 0; i < 7; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var go = FindObj("Image_WinBG/HeroLevelUp/Image_DownShadow/ItemHead" + i);
|
|
|
|
|
|
_itemHeadList.Add(go);
|
|
|
|
|
|
}
|
2024-10-18 14:04:34 +08:00
|
|
|
|
|
|
|
|
|
|
isAddUpAnim = false;
|
|
|
|
|
|
}
|
2023-08-22 19:08:45 +08:00
|
|
|
|
|
2024-07-10 17:09:11 +08:00
|
|
|
|
public override void OnRelease()
|
|
|
|
|
|
{
|
2024-10-18 17:27:09 +08:00
|
|
|
|
//AudioManager.Instance.AudioMgrObj.StopAllSounds();
|
2024-09-20 19:35:03 +08:00
|
|
|
|
if (_seq != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DOTween.Kill(_seq);
|
|
|
|
|
|
_seq = null;
|
|
|
|
|
|
}
|
2024-09-26 19:25:46 +08:00
|
|
|
|
|
|
|
|
|
|
if (_seqPvp != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DOTween.Kill(_seqPvp);
|
|
|
|
|
|
_seqPvp = null;
|
|
|
|
|
|
}
|
2024-09-20 19:35:03 +08:00
|
|
|
|
|
|
|
|
|
|
base.OnRelease();
|
2024-07-10 17:09:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-31 13:39:07 +08:00
|
|
|
|
private void _Refresh()
|
2023-11-08 15:50:08 +08:00
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
var team = _isPvP? TeamEditManager.Instance.GetSelectTeam() : LevelManager.Instance.SettleData.Team;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
var charIDArray = team.GetAllCharacters();
|
|
|
|
|
|
for (int i = 0; i < charIDArray.Count; i++)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
2024-10-15 16:30:20 +08:00
|
|
|
|
if (charIDArray[i] != Team.NoneID)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
_charIDs.Add(charIDArray[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_RefreshInfo();
|
|
|
|
|
|
_RefreshMissionDetail();
|
2024-09-25 15:40:50 +08:00
|
|
|
|
_RefreshWar();
|
2024-09-26 19:25:46 +08:00
|
|
|
|
_RefreshPvP();
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_RefreshCommonExp();
|
|
|
|
|
|
_RefreshHeads();
|
2024-04-24 14:31:42 +08:00
|
|
|
|
|
|
|
|
|
|
if (charIDArray.Count() > 0)
|
2024-05-06 15:35:03 +08:00
|
|
|
|
{
|
|
|
|
|
|
int id = (int)charIDArray[0];
|
|
|
|
|
|
|
|
|
|
|
|
DataCharacterAttri dataCharacterAttri = TableManager.Instance.Tables.CharacterAttri.Get(id);
|
|
|
|
|
|
if (dataCharacterAttri == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"获取角色配置失败,id:{id}");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-11-12 16:47:23 +08:00
|
|
|
|
textName.text = CommonUtils.GetCharacterName(dataCharacterAttri.RoleID);
|
2024-07-31 13:39:07 +08:00
|
|
|
|
dialogueAudio = DialogueManager.Instance.PlayDiaogue(id,
|
2024-04-28 17:01:49 +08:00
|
|
|
|
cfg.DialogueCfg.E_DialogueType.LevelWin,
|
|
|
|
|
|
(content) => { textDialogue.text = content; });
|
2024-05-06 15:35:03 +08:00
|
|
|
|
}
|
2023-11-08 15:50:08 +08:00
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2023-08-22 19:08:45 +08:00
|
|
|
|
//invoke when open window
|
2024-10-10 19:34:45 +08:00
|
|
|
|
protected override void OnShowWindow(object data)
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2024-09-26 19:25:46 +08:00
|
|
|
|
_levelID = _isPvP? GLConfig.Inst.data.PVPLevelID : LevelManager.Instance.SettleData.LevelID;
|
2024-09-20 19:35:03 +08:00
|
|
|
|
|
2024-01-12 16:04:49 +08:00
|
|
|
|
_Refresh();
|
2024-09-23 17:57:10 +08:00
|
|
|
|
}
|
2024-01-12 16:04:49 +08:00
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
protected override void OnUpdate()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnUpdate();
|
2024-04-28 17:01:49 +08:00
|
|
|
|
|
|
|
|
|
|
Image_TextRect.gameObject.IsScaleShow(IsDialoguePlaying);
|
2024-05-06 15:35:03 +08:00
|
|
|
|
}
|
2024-04-28 17:01:49 +08:00
|
|
|
|
|
2024-08-20 15:10:25 +08:00
|
|
|
|
public override async UniTask<bool> OnBack(object data = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
protected override void OnHideWindow()
|
|
|
|
|
|
{
|
2024-09-23 17:57:10 +08:00
|
|
|
|
//AudioManager.Instance.AudioMgrObj.StopAllSounds();
|
2024-04-28 17:01:49 +08:00
|
|
|
|
|
2024-09-23 17:57:10 +08:00
|
|
|
|
base.OnHideWindow();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
#region RefreshWindow
|
2024-04-28 17:01:49 +08:00
|
|
|
|
|
2024-05-06 15:35:03 +08:00
|
|
|
|
private void _RefreshInfo()
|
2023-08-22 19:08:45 +08:00
|
|
|
|
{
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_RefreshMapDetail();
|
2023-08-22 19:08:45 +08:00
|
|
|
|
}
|
2024-01-12 16:04:49 +08:00
|
|
|
|
|
2024-01-15 13:53:01 +08:00
|
|
|
|
private void _RefreshMapDetail()
|
|
|
|
|
|
{
|
2024-11-05 15:53:08 +08:00
|
|
|
|
if (!_isPvP && !isSweep)
|
2024-10-31 14:37:12 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance == null || LevelManager.Instance.CurrentLevel == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-01-15 13:53:01 +08:00
|
|
|
|
_RefreshTime();
|
2024-10-12 19:29:23 +08:00
|
|
|
|
_RefreshEv();
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_RefreshLevelInfo();
|
|
|
|
|
|
_RefreshPlayerInfo();
|
2024-01-15 13:53:01 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-12 19:29:23 +08:00
|
|
|
|
private async void _RefreshEv()
|
|
|
|
|
|
{
|
|
|
|
|
|
var root = FindObj("Image_WinBG/MapDetail");
|
|
|
|
|
|
var imgDay = CommonUtils.GetComponent<Image>(root, "Image_Fight");
|
|
|
|
|
|
var txtDay = CommonUtils.GetComponent<TMP_Text>(root, "Image_Fight/Text_Fight");
|
|
|
|
|
|
var imgWeather = CommonUtils.GetComponent<Image>(root, "Enviroments/Image_Enviroment0");
|
|
|
|
|
|
var txtWeather = CommonUtils.GetComponent<TMP_Text>(root, "Enviroments/Image_Enviroment0/Text_Current");
|
|
|
|
|
|
var imgEv = CommonUtils.GetComponent<Image>(root, "Enviroments/Image_Enviroment1");
|
|
|
|
|
|
var txtEv = CommonUtils.GetComponent<TMP_Text>(root, "Enviroments/Image_Enviroment1/Text_Current");
|
2024-10-15 19:11:48 +08:00
|
|
|
|
|
|
|
|
|
|
LevelInfo levelInfo;
|
|
|
|
|
|
if (isSweep)
|
|
|
|
|
|
levelInfo = LevelManager.Instance.CurrLevel;
|
|
|
|
|
|
else
|
|
|
|
|
|
LevelManager.Instance.TryGetLevelInfoByID(LevelManager.Instance.CurrentLevel.ID, out levelInfo);
|
|
|
|
|
|
|
2024-10-12 19:29:23 +08:00
|
|
|
|
if (levelInfo != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var dayNightConfig = CommonUtils.GetDayNightConfig(levelInfo.Cfg.LevelTime);
|
|
|
|
|
|
imgDay.sprite = await LoadAssetAsync<Sprite>(dayNightConfig.Icon);
|
|
|
|
|
|
txtDay.text = CommonUtils.GetLocalizeText(dayNightConfig.NameLocal);
|
|
|
|
|
|
|
|
|
|
|
|
var weatherType = levelInfo.Cfg.LevelWeather;
|
|
|
|
|
|
var weatherConfig = CommonUtils.GetWeatherConfig(weatherType);
|
|
|
|
|
|
imgWeather.sprite = await LoadAssetAsync<Sprite>(weatherConfig.Icon);
|
|
|
|
|
|
txtWeather.text = CommonUtils.GetLocalizeText(weatherConfig.NameLocal);
|
|
|
|
|
|
|
|
|
|
|
|
var type = levelInfo.Environment;
|
|
|
|
|
|
var environmentCfg = CommonUtils.GetEnvironmentConfig(type);
|
|
|
|
|
|
imgEv.sprite = await LoadAssetAsync<Sprite>(environmentCfg.Icon);
|
|
|
|
|
|
txtEv.text = CommonUtils.GetLocalizeText(environmentCfg.NameLocal);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-15 13:53:01 +08:00
|
|
|
|
private async void _RefreshLevelInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
var level = LevelManager.Instance.CurrLevel;
|
2024-08-05 20:05:12 +08:00
|
|
|
|
//var levelName = level.Name;
|
|
|
|
|
|
//Text_LevelName.text = levelName;
|
2024-09-26 19:25:46 +08:00
|
|
|
|
if (_isPvP)
|
|
|
|
|
|
{
|
2024-09-27 19:42:19 +08:00
|
|
|
|
Text_Mode.text = CommonUtils.GetLocalizeText("level_chapter_type_pvp");
|
|
|
|
|
|
Text_LevelNum.text = CommonUtils.GetLocalizeText("pvp_level_desc");
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (_isWar)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Mode.text = CommonUtils.GetLocalizeText("level_chapter_type_war");
|
|
|
|
|
|
Text_LevelNum.text = LevelManager.Instance.LevelIDToNum(level.Cfg.Id);
|
2024-09-26 19:25:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
2024-09-27 19:42:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
Text_Mode.text = CommonUtils.GetLocalizeText("level_chapter_type_normal");//CommonUtils.GetCurLevelTypeStr();
|
|
|
|
|
|
Text_LevelNum.text = LevelManager.Instance.LevelIDToNum(level.Cfg.Id);
|
|
|
|
|
|
}
|
2024-01-15 13:53:01 +08:00
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-15 13:53:01 +08:00
|
|
|
|
private void _RefreshTime()
|
|
|
|
|
|
{
|
2024-09-20 18:33:26 +08:00
|
|
|
|
if (isSweep)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Time.gameObject.IsScaleShow(false);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-15 13:53:01 +08:00
|
|
|
|
var minutes = TeamManager.Instance.GetFightPastMinute();
|
|
|
|
|
|
var seconds = TeamManager.Instance.GetFightPastSecond();
|
|
|
|
|
|
var timeStr = "";
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-07-04 14:43:55 +08:00
|
|
|
|
if (minutes >= 10)
|
2024-01-15 13:53:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
timeStr += minutes;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
timeStr += "0";
|
|
|
|
|
|
timeStr += minutes;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
timeStr += ":";
|
|
|
|
|
|
|
2024-07-04 14:43:55 +08:00
|
|
|
|
if (seconds >= 10)
|
2024-01-15 13:53:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
timeStr += seconds;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
timeStr += "0";
|
|
|
|
|
|
timeStr += seconds;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Text_Time.text = timeStr;
|
2024-09-20 18:33:26 +08:00
|
|
|
|
Text_Time.gameObject.IsScaleShow(true);
|
|
|
|
|
|
}
|
2024-01-15 13:53:01 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
private void _RefreshPlayerInfo()
|
|
|
|
|
|
{
|
2024-09-26 19:25:46 +08:00
|
|
|
|
if (_isPvP)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-07-04 13:49:45 +08:00
|
|
|
|
var playerName = Actor.Instance.Base.Nickname;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var playerLv = Actor.Instance.Base.GetProp(ActorProp.Level);
|
2024-07-04 13:49:45 +08:00
|
|
|
|
Text_CharacterID.text = playerName;
|
2024-07-05 21:26:37 +08:00
|
|
|
|
|
2024-09-02 14:55:43 +08:00
|
|
|
|
if (GuideManager.Instance.IsGuiding && 100001 == LevelManager.Instance.CurrLevel.Cfg.Id)
|
2024-07-05 21:26:37 +08:00
|
|
|
|
Text_CharacterID.gameObject.IsScaleShow(false);
|
|
|
|
|
|
else
|
|
|
|
|
|
Text_CharacterID.gameObject.IsScaleShow(true);
|
|
|
|
|
|
|
2024-11-14 19:22:16 +08:00
|
|
|
|
Text_CharacterLV.text = CommonUtils.GetLocalizeText("level_desc_pre") + "." + playerLv;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
2024-10-25 14:16:40 +08:00
|
|
|
|
var maxLevel = ActorLevelTableHelper.Instance.GetPlayerMaxLevel();
|
|
|
|
|
|
if (playerLv >= maxLevel)
|
|
|
|
|
|
{
|
|
|
|
|
|
Image_EXFull.fillAmount = 1;
|
|
|
|
|
|
Text_EX.text = CommonUtils.GetLocalizeText("player_level_max");
|
|
|
|
|
|
Text_LVUp.text = "";
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-07-11 19:58:19 +08:00
|
|
|
|
var max = ActorLevelTableHelper.Instance.GetLevelUpExp((int)playerLv);//actorCfg.Exp;
|
|
|
|
|
|
var cur = Actor.Instance.Base.GetProp(ActorProp.Exp);
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var process = (float)cur / max;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var oldLvExp = LevelManager.Instance.SettleData.PlayerLvExp;
|
|
|
|
|
|
var lvDiff = playerLv - oldLvExp.Lv;
|
|
|
|
|
|
var oldLv = oldLvExp.Lv;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
int add = _CalculateExp();
|
2024-07-10 17:09:11 +08:00
|
|
|
|
Image_EXFull.fillAmount = (float)oldLvExp.Exp / max;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
Text_LVUp.text = "+" + add;
|
|
|
|
|
|
Text_EX.text = cur + "/" + max;
|
2024-07-10 17:09:11 +08:00
|
|
|
|
//Image_EXFull.fillAmount = process;
|
|
|
|
|
|
_playerLvUp = (int)lvDiff;
|
|
|
|
|
|
_PlayAnim(process);
|
2024-01-22 13:45:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _CalculateExp()
|
|
|
|
|
|
{
|
|
|
|
|
|
int retExp = 0;
|
|
|
|
|
|
var oldExp = LevelManager.Instance.SettleData.PlayerLvExp.Exp;
|
|
|
|
|
|
var oldLv = LevelManager.Instance.SettleData.PlayerLvExp.Lv;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
var curLv = Actor.Instance.Base.GetProp(ActorProp.Level);
|
|
|
|
|
|
var curExp = Actor.Instance.Base.GetProp(ActorProp.Exp);
|
|
|
|
|
|
if (oldLv < curLv)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
2024-07-11 19:58:19 +08:00
|
|
|
|
var oldActorLvExp = ActorLevelTableHelper.Instance.GetLevelUpExp((int)oldLv);//Cfg = ActorLevelTableHelper.Instance.Get((int)oldLv);
|
|
|
|
|
|
retExp += oldActorLvExp - (int)oldExp;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
for (uint i = oldLv + 1; i < curLv; i++)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
2024-07-11 19:58:19 +08:00
|
|
|
|
var curLvExp = ActorLevelTableHelper.Instance.GetLevelUpExp((int)i);
|
|
|
|
|
|
retExp += curLvExp;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
retExp += (int)curExp;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2024-01-22 13:45:43 +08:00
|
|
|
|
retExp += (int)(curExp - oldExp);
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
return retExp;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
2024-09-25 15:40:50 +08:00
|
|
|
|
private async void _RefreshWar()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isWar)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-26 14:46:49 +08:00
|
|
|
|
_goMissionDetail.SetActive(false);
|
|
|
|
|
|
_goCharDetail.SetActive(false);
|
|
|
|
|
|
_goWarDetail.SetActive(true);
|
|
|
|
|
|
_goPvPDetail.SetActive(false);
|
2024-09-26 15:08:23 +08:00
|
|
|
|
_scrollWar.Init(_RefreshWarItem);
|
2024-09-26 14:46:49 +08:00
|
|
|
|
|
2024-09-25 15:40:50 +08:00
|
|
|
|
var levelInfo = LevelManager.Instance.CurrentLevel.GetLevelInfo();
|
|
|
|
|
|
var txtScore = CommonUtils.GetComponent<TMP_Text>(_goWarDetail, "Image_WarGrades/Text_Grades");
|
|
|
|
|
|
var imgRating = CommonUtils.GetComponent<Image>(_goWarDetail, "Image_WarGrades/Image_RatingLevelIcon");
|
|
|
|
|
|
txtScore.text = levelInfo.Score.ToString();
|
|
|
|
|
|
imgRating.sprite = await LoadAssetAsync<Sprite>(WarRating.WarRatingPath[levelInfo.WarRating]);
|
|
|
|
|
|
_scrollWar.ShowList(_GetScrollCount());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshWarItem(GameObject go, int index)
|
|
|
|
|
|
{
|
|
|
|
|
|
var complete = LevelManager.Instance.CurrentLevel.GetStarIsSuccess(index);
|
|
|
|
|
|
var rootComplete = CommonUtils.GetGameObject(go, "UI_Complete");
|
|
|
|
|
|
var rootInComplete = CommonUtils.GetGameObject(go, "UI_Incomplete");
|
|
|
|
|
|
rootComplete.SetActive(complete);
|
|
|
|
|
|
rootInComplete.SetActive(!complete);
|
|
|
|
|
|
|
|
|
|
|
|
var root = complete ? rootComplete : rootInComplete;
|
|
|
|
|
|
var txtScore = CommonUtils.GetComponent<TMP_Text>(root, "Text_PlusScore");
|
|
|
|
|
|
var txtDesc = CommonUtils.GetComponent<TMP_Text>(root, "Text_TargetMission");
|
|
|
|
|
|
var score = LevelManager.Instance.CurrentLevel.GetLevelInfo().GetScoreTarget(index);
|
|
|
|
|
|
var desc = LevelManager.Instance.CurrentLevel.GetScoreTargetLocalization(index);
|
|
|
|
|
|
txtScore.text = "+" + score;
|
|
|
|
|
|
txtDesc.text = desc;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _GetScrollCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
var levelData = LevelManager.Instance.CurrentLevel.GetLevelData();
|
|
|
|
|
|
return levelData.scoreTarget.Count;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
private void _RefreshMissionDetail()
|
|
|
|
|
|
{
|
2024-09-26 14:46:49 +08:00
|
|
|
|
if (_isWar || _isPvP)
|
2024-09-25 15:40:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-09-26 14:46:49 +08:00
|
|
|
|
|
|
|
|
|
|
_goMissionDetail.SetActive(true);
|
|
|
|
|
|
_goCharDetail.SetActive(true);
|
|
|
|
|
|
_goWarDetail.SetActive(false);
|
|
|
|
|
|
_goPvPDetail.SetActive(false);
|
|
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
_RefreshStars();
|
|
|
|
|
|
_RefreshAimInfo();
|
|
|
|
|
|
}
|
2024-09-25 15:40:50 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
private void _RefreshStars()
|
|
|
|
|
|
{
|
2024-09-20 19:00:18 +08:00
|
|
|
|
if (isSweep)
|
|
|
|
|
|
{
|
2024-10-22 17:14:15 +08:00
|
|
|
|
for (int i = 0; i < _imgWinStar.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
_imgWinStar[i].gameObject.SetActive(true);
|
|
|
|
|
|
_imageFailedStart[i].gameObject.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
return;
|
2024-09-20 19:00:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
for (int i = 0; i < _imgWinStar.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var isFinish = LevelManager.Instance.CurrentLevel.GetStarIsSuccess(i);
|
|
|
|
|
|
_imgWinStar[i].gameObject.SetActive(isFinish);
|
|
|
|
|
|
_imageFailedStart[i].gameObject.SetActive(!isFinish);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshAimInfo()
|
|
|
|
|
|
{
|
2024-08-06 13:40:53 +08:00
|
|
|
|
//var levelInfo = LevelManager.Instance.GetLevelInfoByID(_levelID);
|
2024-01-31 16:24:32 +08:00
|
|
|
|
var levelCfg = TableManager.Instance.Tables.Level.GetOrDefault(_levelID);
|
|
|
|
|
|
var levelRewardID = new List<List<int>>(3);
|
|
|
|
|
|
if (levelCfg != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
levelRewardID.Add(new List<int>(levelCfg.StarRewardID1));
|
|
|
|
|
|
levelRewardID.Add(new List<int>(levelCfg.StarRewardID2));
|
|
|
|
|
|
levelRewardID.Add(new List<int>(levelCfg.StarRewardID3));
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
for (int i = 0; i < _aimObjList.Count; i++)
|
|
|
|
|
|
{
|
2024-08-06 13:40:53 +08:00
|
|
|
|
var txtContent = "";
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var aimObj = _aimObjList[i];
|
2024-10-22 17:14:15 +08:00
|
|
|
|
aimObj.gameObject.SetActive(true);
|
2024-09-20 19:00:18 +08:00
|
|
|
|
var txtDesc = CommonUtils.GetComponent<TMP_Text>(aimObj, "TextDescribe");
|
2024-10-22 17:14:15 +08:00
|
|
|
|
|
|
|
|
|
|
var txtGetItem = CommonUtils.GetComponent<TMP_Text>(aimObj, "TextGetItem");
|
|
|
|
|
|
var txtGetItemFailed = CommonUtils.GetComponent<TMP_Text>(aimObj, "TextGetItemFailed");
|
|
|
|
|
|
bool isFinish = isSweep ? true : LevelManager.Instance.CurrentLevel.GetStarIsSuccess(i);
|
2024-08-06 13:40:53 +08:00
|
|
|
|
txtGetItem.gameObject.SetActive(isFinish);
|
|
|
|
|
|
txtGetItemFailed.gameObject.SetActive(!isFinish);
|
2024-10-22 17:14:15 +08:00
|
|
|
|
txtDesc.text = LevelManager.Instance.CurrLevel.GetStarTargetLocalizationText(i);
|
2024-01-31 16:24:32 +08:00
|
|
|
|
|
2024-08-06 13:40:53 +08:00
|
|
|
|
if (levelCfg != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var levelRewardL = levelRewardID[i];
|
|
|
|
|
|
if (levelRewardL.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var itemList = CommonUtils.GetFilterRewardItemList(levelRewardL);
|
|
|
|
|
|
for (int n = 0; n < itemList.Count; n++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var list = itemList[n];
|
|
|
|
|
|
var itemID = list.ID;
|
|
|
|
|
|
var itemCfg = TableManager.Instance.Tables.Item.GetOrDefault(itemID);
|
|
|
|
|
|
if (itemCfg != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var name = CommonUtils.GetLocalizeText(itemCfg.NameLocal);
|
|
|
|
|
|
txtContent += name + "x" + list.Count;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-31 16:24:32 +08:00
|
|
|
|
txtGetItem.text = txtContent;
|
2024-08-06 13:40:53 +08:00
|
|
|
|
txtGetItemFailed.text = txtContent;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshCommonExp()
|
|
|
|
|
|
{
|
2024-09-26 19:25:46 +08:00
|
|
|
|
if (_isPvP)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_GeneralEX.gameObject.SetActive(false);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-01-18 16:25:15 +08:00
|
|
|
|
var list = _itemList.Lists;
|
|
|
|
|
|
int itemCount = 0;
|
|
|
|
|
|
for (var i = ItemSource.LevelPassNormal; i <= ItemSource.LevelPassStar3; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
itemCount += _CalculateExpItemCount(list[(int)i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var settleData = LevelManager.Instance.SettleData;
|
|
|
|
|
|
Text_EXPHave.text = settleData.CommonExp.ToString();
|
|
|
|
|
|
Text_EXPGet.text = "+" + itemCount;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private int _CalculateExpItemCount(ItemCounts itemCounts)
|
|
|
|
|
|
{
|
|
|
|
|
|
int retCount = 0;
|
|
|
|
|
|
if (itemCounts.Ids.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idx = itemCounts.Ids.IndexOf(3);
|
|
|
|
|
|
if (idx >= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var count = itemCounts.Counts[idx];
|
|
|
|
|
|
retCount = (int)count;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-18 16:25:15 +08:00
|
|
|
|
return retCount;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-10 19:34:45 +08:00
|
|
|
|
private async void _RefreshHeads()
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
2024-10-10 19:34:45 +08:00
|
|
|
|
for (int i = 0; i < _itemHeadList.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
_itemHeadList[i].IsScaleShow(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await AssetManager.Instance.WaitAllPreloads();
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < _itemHeadList.Count; i++)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
_RefreshHead(i);
|
2024-10-10 19:34:45 +08:00
|
|
|
|
_itemHeadList[i].IsScaleShow(true);
|
|
|
|
|
|
}
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-06 13:40:53 +08:00
|
|
|
|
private async void _RefreshHead(int idx)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
var item = _itemHeadList[idx];
|
|
|
|
|
|
if (idx >= _charIDs.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
item.SetActive(false);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
item.SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
var uid = _charIDs[idx];
|
|
|
|
|
|
var headNode = CommonUtils.GetComponent<UIHeadItemNode>(item, "HeadNode");
|
|
|
|
|
|
if (headNode)
|
|
|
|
|
|
{
|
|
|
|
|
|
var headInfo = new UIHeadInfo(uid);
|
|
|
|
|
|
headNode.SetData(headInfo);
|
|
|
|
|
|
headNode.Refresh(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-08-06 13:40:53 +08:00
|
|
|
|
var imgPro = CommonUtils.GetComponent<Image>(item, "ImageProfessionRect/ImageProfession");
|
|
|
|
|
|
var job = CommonUtils.GetProfessionByUid(uid);
|
|
|
|
|
|
var jobData = TableManager.Instance.Tables.JobAttri.GetOrDefault((int)job);
|
|
|
|
|
|
var spritePath = jobData.IconPath;
|
|
|
|
|
|
var sprite = await LoadAssetAsync<Sprite>(spritePath);
|
|
|
|
|
|
imgPro.sprite = sprite;
|
2024-09-26 19:25:46 +08:00
|
|
|
|
|
|
|
|
|
|
if (_isPvP)
|
|
|
|
|
|
{
|
|
|
|
|
|
CommonUtils.GetGameObject(item, "ImageFavorate").SetActive(false);
|
|
|
|
|
|
CommonUtils.GetGameObject(item, "ImageHeroEXpEmpty").SetActive(false);
|
|
|
|
|
|
CommonUtils.GetGameObject(item, "Image_SerialNumber").SetActive(false);
|
|
|
|
|
|
CommonUtils.GetGameObject(item, "TextHeroLV").SetActive(false);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var txtTeamIdx = CommonUtils.GetComponent<TMP_Text>(item, "Image_SerialNumber/Text_Number");
|
|
|
|
|
|
var team = LevelManager.Instance.SettleData.Team;
|
2024-10-21 16:51:06 +08:00
|
|
|
|
var teamIdx = team.GetAllCharacterIdx(uid);//team.GetAllCharacters().IndexOf(uid);
|
|
|
|
|
|
txtTeamIdx.text = (teamIdx + 1).ToString();
|
2024-08-06 13:40:53 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var txtExpAdd = CommonUtils.GetComponent<TMP_Text>(item, "ImageHeroEXpEmpty/TextHeroEXPUp");
|
|
|
|
|
|
var imgExpProcess = CommonUtils.GetComponent<Image>(item, "ImageHeroEXpEmpty/ImageHeroEXpFull");
|
|
|
|
|
|
var txtLv = CommonUtils.GetComponent<TMP_Text>(item, "TextHeroLV");
|
2024-10-28 16:16:09 +08:00
|
|
|
|
var goMaxLevel = CommonUtils.GetGameObject(item, "Text_MaxLv");
|
|
|
|
|
|
bool isMaxLevel = CommonUtils.CheckIsCharacterMaxLevel(uid);
|
2024-01-17 12:57:07 +08:00
|
|
|
|
var addExp = _CalculateCharExpAdd(uid);
|
2024-10-28 16:16:09 +08:00
|
|
|
|
if (addExp > 0 && !isMaxLevel)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
txtExpAdd.text = "+" + addExp;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
txtExpAdd.text = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (CharacterDataInfoManager.Instance.DataDic.TryGetValue(uid, out var charDataInfo))
|
|
|
|
|
|
{
|
2024-10-28 16:16:09 +08:00
|
|
|
|
if (isMaxLevel)
|
|
|
|
|
|
{
|
|
|
|
|
|
imgExpProcess.fillAmount = 1;
|
|
|
|
|
|
goMaxLevel.SetActiveEx(true);
|
2024-11-14 19:22:16 +08:00
|
|
|
|
txtLv.text = CommonUtils.GetLocalizeText("level_desc_pre") + " " + charDataInfo.Level;
|
2024-10-28 16:16:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
goMaxLevel.SetActiveEx(false);
|
|
|
|
|
|
var cur = charDataInfo.Exp;
|
|
|
|
|
|
var cfg = TableManager.Instance.Tables.CharacterLevelExp.GetOrDefault((int)charDataInfo.Level + 1);
|
|
|
|
|
|
var process = (float)cur / cfg.EXP;
|
|
|
|
|
|
imgExpProcess.fillAmount = process;
|
2024-11-14 19:22:16 +08:00
|
|
|
|
txtLv.text = CommonUtils.GetLocalizeText("level_desc_pre") + " " + charDataInfo.Level;
|
2024-10-28 16:16:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
2024-01-22 13:45:43 +08:00
|
|
|
|
|
|
|
|
|
|
var imgLikely = CommonUtils.GetComponent<Image>(item, "ImageFavorate");
|
|
|
|
|
|
var txtLikely = CommonUtils.GetComponent<TMP_Text>(item, "ImageFavorate/TextFavorateEXp");
|
|
|
|
|
|
var likely = _CalculateLikely(uid);
|
|
|
|
|
|
if (likely > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
txtLikely.text = "+" + likely;
|
|
|
|
|
|
imgLikely.gameObject.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
imgLikely.gameObject.SetActive(false);
|
|
|
|
|
|
}
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-12 16:04:49 +08:00
|
|
|
|
#endregion
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
#region Data
|
2024-07-22 19:59:13 +08:00
|
|
|
|
private int _CalculateCharExpAdd(uint roleID)
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
2024-07-22 19:59:13 +08:00
|
|
|
|
int add = 0;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
var lvExp = LevelManager.Instance.SettleData.ExpDic[roleID];
|
2024-05-06 15:35:03 +08:00
|
|
|
|
if (CharacterDataInfoManager.Instance.DataDic.TryGetValue(roleID, out var charDataInfo))
|
2024-01-17 12:57:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
var oldLv = lvExp.Lv;
|
2024-07-22 19:59:13 +08:00
|
|
|
|
var oldExp = (int)lvExp.Exp;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
|
|
|
|
|
var curLv = charDataInfo.Level;
|
2024-07-22 19:59:13 +08:00
|
|
|
|
var curExp = (int)charDataInfo.Exp;
|
|
|
|
|
|
|
|
|
|
|
|
if (curLv == TableManager.Instance.Tables.CharacterLevelExp.DataList.Count)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
2024-01-17 12:57:07 +08:00
|
|
|
|
|
|
|
|
|
|
if (oldLv < curLv)
|
|
|
|
|
|
{
|
2024-07-22 19:59:13 +08:00
|
|
|
|
var expCfg = TableManager.Instance.Tables.CharacterLevelExp.GetOrDefault((int)oldLv + 1);
|
|
|
|
|
|
add += (expCfg.EXP - oldExp);
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
for (uint i = oldLv + 1; i < curLv; i++)
|
|
|
|
|
|
{
|
2024-10-24 13:43:08 +08:00
|
|
|
|
var cfg = TableManager.Instance.Tables.CharacterLevelExp.GetOrDefault((int)i + 1);
|
2024-07-22 19:59:13 +08:00
|
|
|
|
add += cfg.EXP;
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
add += curExp;
|
2024-10-24 13:43:08 +08:00
|
|
|
|
|
2024-01-17 12:57:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
add += curExp - oldExp;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return add;
|
|
|
|
|
|
}
|
2024-01-17 18:53:40 +08:00
|
|
|
|
|
2024-08-12 19:31:50 +08:00
|
|
|
|
private int _CalculateLikely(uint roleID)
|
2024-01-22 13:45:43 +08:00
|
|
|
|
{
|
2024-08-12 19:31:50 +08:00
|
|
|
|
int retCount = 0;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
var lvExp = LevelManager.Instance.SettleData.FavorDic[roleID];
|
|
|
|
|
|
if (CharacterDataInfoManager.Instance.DataDic.TryGetValue(roleID, out var charDataInfo))
|
|
|
|
|
|
{
|
2024-08-12 19:31:50 +08:00
|
|
|
|
var oldExp = (int)lvExp.Exp;
|
|
|
|
|
|
var oldLv = (int)lvExp.Lv;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-08-12 19:31:50 +08:00
|
|
|
|
var curLv = (int)charDataInfo.LikelyLevel;
|
|
|
|
|
|
var curExp = (int)charDataInfo.LikelyExp;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
if (oldLv < curLv)
|
|
|
|
|
|
{
|
2024-08-12 19:31:50 +08:00
|
|
|
|
var expCfg = TableManager.Instance.Tables.CharacterLikability.Get((int)roleID, oldLv + 1);
|
|
|
|
|
|
if (expCfg == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
retCount += expCfg.LikabilityExp - oldExp;
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-08-12 19:31:50 +08:00
|
|
|
|
for (int i = oldLv + 1; i < curLv; i++)
|
2024-01-22 13:45:43 +08:00
|
|
|
|
{
|
2024-08-12 19:31:50 +08:00
|
|
|
|
var cfg = TableManager.Instance.Tables.CharacterLikability.Get((int)roleID, i + 1);
|
|
|
|
|
|
retCount += cfg.LikabilityExp;
|
2024-01-22 13:45:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
retCount += curExp;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
retCount += curExp - oldExp;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
return retCount;
|
|
|
|
|
|
}
|
2024-05-06 15:35:03 +08:00
|
|
|
|
|
2024-01-22 13:45:43 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2024-01-17 18:53:40 +08:00
|
|
|
|
private async void _OnClickClose()
|
|
|
|
|
|
{
|
2024-09-26 19:25:46 +08:00
|
|
|
|
if (_isPlayingAnim || _isPlaying)
|
2024-07-10 17:09:11 +08:00
|
|
|
|
return;
|
2024-08-13 14:29:50 +08:00
|
|
|
|
|
2024-09-18 16:50:48 +08:00
|
|
|
|
int rewardCnt = 0;
|
|
|
|
|
|
foreach(var item in _itemList.Lists)
|
|
|
|
|
|
{
|
|
|
|
|
|
rewardCnt += item.Counts.Count;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-27 19:51:01 +08:00
|
|
|
|
async void Cb()
|
|
|
|
|
|
{
|
|
|
|
|
|
await GameSceneHelper.Instance.UnLoadSceneForRt();
|
|
|
|
|
|
AudioManager.Instance.StopAll();
|
|
|
|
|
|
AudioManager.Instance.ReleaseAllAudios();
|
|
|
|
|
|
LevelManager.Instance.ExitLevelDirectly();
|
|
|
|
|
|
EffectManager.instance.rootObj.SetActive(true);
|
2024-10-18 12:52:11 +08:00
|
|
|
|
//PVPManager.Instance.RewardItemList = null;
|
2024-09-27 19:51:01 +08:00
|
|
|
|
CloseWindow();
|
|
|
|
|
|
}
|
2024-09-27 19:42:19 +08:00
|
|
|
|
if (_isPvP)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (rewardCnt <= 0)
|
|
|
|
|
|
{
|
2024-09-27 19:51:01 +08:00
|
|
|
|
await GameSceneHelper.Instance.UnLoadSceneForRt();
|
2024-09-27 19:42:19 +08:00
|
|
|
|
AudioManager.Instance.StopAll();
|
|
|
|
|
|
AudioManager.Instance.ReleaseAllAudios();
|
|
|
|
|
|
LevelManager.Instance.ExitLevelDirectly();
|
|
|
|
|
|
EffectManager.instance.rootObj.SetActive(true);
|
2024-10-18 12:52:11 +08:00
|
|
|
|
//PVPManager.Instance.RewardItemList = null;
|
2024-09-27 19:42:19 +08:00
|
|
|
|
CloseWindow();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-09-27 19:51:01 +08:00
|
|
|
|
await UI_GetItemWindowController.Open(_itemList, UI_GetItemWindowController.EShowType.StorySettle, Cb);
|
2024-09-27 19:42:19 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-09-18 16:50:48 +08:00
|
|
|
|
if (rewardCnt > 0)
|
2024-08-23 19:53:32 +08:00
|
|
|
|
{
|
2024-09-02 17:12:12 +08:00
|
|
|
|
//await UI_GetItemSettleController.Open(_itemList);
|
2024-09-27 19:06:18 +08:00
|
|
|
|
await UI_GetItemWindowController.Open(_itemList, UI_GetItemWindowController.EShowType.StorySettle, cb: () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
ExitFromLevel();
|
|
|
|
|
|
});
|
2024-09-23 18:00:15 +08:00
|
|
|
|
if (isSweep)
|
|
|
|
|
|
CloseWindow();
|
2024-09-02 17:12:12 +08:00
|
|
|
|
|
2024-08-23 19:53:32 +08:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-09-26 19:25:46 +08:00
|
|
|
|
|
2024-08-23 19:53:32 +08:00
|
|
|
|
await GameSceneHelper.Instance.UnLoadSceneForRt();
|
|
|
|
|
|
AudioManager.Instance.StopAll();
|
|
|
|
|
|
AudioManager.Instance.ReleaseAllAudios();
|
|
|
|
|
|
LevelManager.Instance.ExitLevelDirectly();
|
|
|
|
|
|
EffectManager.instance.rootObj.SetActive(true);
|
2024-09-26 19:25:46 +08:00
|
|
|
|
CloseWindow();
|
2024-08-23 19:53:32 +08:00
|
|
|
|
|
2024-01-17 18:53:40 +08:00
|
|
|
|
}
|
2024-09-27 19:06:18 +08:00
|
|
|
|
async void ExitFromLevel()
|
|
|
|
|
|
{
|
|
|
|
|
|
await GameSceneHelper.Instance.UnLoadSceneForRt();
|
|
|
|
|
|
AudioManager.Instance.StopAll();
|
2024-10-16 15:18:33 +08:00
|
|
|
|
AudioManager.Instance.ReleaseAllAudios();
|
2024-09-27 19:06:18 +08:00
|
|
|
|
LevelManager.Instance.ExitLevelDirectly();
|
|
|
|
|
|
EffectManager.instance.rootObj.SetActive(true);
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UIMissionWin);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#region Anim
|
2024-07-10 17:09:11 +08:00
|
|
|
|
|
2024-09-27 19:06:18 +08:00
|
|
|
|
private async void _PlayAnim(float process)
|
2024-07-10 17:09:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (!_isPlayingAnim)
|
|
|
|
|
|
{
|
|
|
|
|
|
_seq = DOTween.Sequence();
|
2024-10-23 17:01:54 +08:00
|
|
|
|
_isPlayingAnim = true;
|
|
|
|
|
|
//await UniTask.Delay(250);
|
|
|
|
|
|
_seq.AppendInterval(0.4f);
|
2024-07-10 17:09:11 +08:00
|
|
|
|
if (_playerLvUp > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
for (int i = 1; i <= _playerLvUp; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
_seq.Append(Image_EXFull.DOFillAmount(1, 0.8f));
|
|
|
|
|
|
_seq.AppendCallback(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Image_EXFull.fillAmount = 0;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-18 14:04:34 +08:00
|
|
|
|
if (process > 0 && !isAddUpAnim)
|
2024-07-10 17:09:11 +08:00
|
|
|
|
{
|
2024-10-18 14:04:34 +08:00
|
|
|
|
isAddUpAnim = true;
|
|
|
|
|
|
_seq.Append(Image_EXFull.DOFillAmount(process, 0.5f));
|
2024-07-10 17:09:11 +08:00
|
|
|
|
_seq.AppendInterval(0.25f);
|
2024-10-24 13:17:35 +08:00
|
|
|
|
_seq.AppendCallback(_ShowLevelupWindow);
|
2024-10-24 16:05:53 +08:00
|
|
|
|
_seq.AppendInterval(0.25f);
|
|
|
|
|
|
_seq.AppendCallback(() =>
|
2024-10-23 17:01:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
_isPlayingAnim = false;
|
|
|
|
|
|
});
|
2024-07-10 17:09:11 +08:00
|
|
|
|
}
|
2024-10-23 18:31:49 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2024-10-30 18:53:14 +08:00
|
|
|
|
_seq.AppendCallback(_ShowLevelupWindow);
|
|
|
|
|
|
_seq.AppendInterval(0.25f);
|
2024-10-23 18:31:49 +08:00
|
|
|
|
_seq.AppendCallback(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
_isPlayingAnim = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2024-07-10 17:09:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-24 13:17:35 +08:00
|
|
|
|
private async void _ShowLevelupWindow()
|
2024-07-10 17:09:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (_playerLvUp < 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2024-10-18 14:04:34 +08:00
|
|
|
|
|
|
|
|
|
|
var oldLvExp = LevelManager.Instance.SettleData.PlayerLvExp;
|
2024-07-10 17:09:11 +08:00
|
|
|
|
var curLv = Actor.Instance.Base.GetProp(ActorProp.Level);
|
|
|
|
|
|
await UI_PlayerLevelUpInfoController.Open((int)oldLvExp.Lv, (int)curLv);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-09-26 19:25:46 +08:00
|
|
|
|
|
|
|
|
|
|
#region PVP
|
|
|
|
|
|
private void _RefreshPvP()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!_isPvP)
|
|
|
|
|
|
{
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_goMissionDetail.SetActive(false);
|
|
|
|
|
|
_goCharDetail.SetActive(false);
|
|
|
|
|
|
_goWarDetail.SetActive(false);
|
|
|
|
|
|
_goPvPDetail.SetActive(true);
|
|
|
|
|
|
|
|
|
|
|
|
_RefreshTitle();
|
|
|
|
|
|
_RefreshAnim();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshTitle()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_isPvPSuccess)
|
|
|
|
|
|
{
|
|
|
|
|
|
Text_Win.text = CommonUtils.GetLocalizeText("pvp_settle_title_suc");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
Text_Win.text = CommonUtils.GetLocalizeText("pvp_settle_title_defeat");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshAnim()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (_seqPvp == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
_seqPvp = DOTween.Sequence();
|
|
|
|
|
|
}
|
|
|
|
|
|
_RefreshPvPScore();
|
|
|
|
|
|
_RefreshPvPRank();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshPvPScore()
|
|
|
|
|
|
{
|
|
|
|
|
|
var old = _settleData.Score;
|
|
|
|
|
|
var now = _newPVPData.Score;
|
|
|
|
|
|
var add = now - old;
|
|
|
|
|
|
var txtScoreChange = CommonUtils.GetComponent<TMP_Text>(_goPvPDetail, "Image_Score/Text_Change");
|
|
|
|
|
|
var txtScore = CommonUtils.GetComponent<TMP_Text>(_goPvPDetail, "Image_Score/Text_Current");
|
|
|
|
|
|
var imgAdd = CommonUtils.GetComponent<Image>(_goPvPDetail, "Image_Score/Image_Increase");
|
|
|
|
|
|
var imgDecrease = CommonUtils.GetComponent<Image>(_goPvPDetail, "Image_Score/Image_Decrease");
|
|
|
|
|
|
if (add == 0)
|
|
|
|
|
|
txtScoreChange.text = "";
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
imgAdd.gameObject.SetActive(_isPvPSuccess);
|
|
|
|
|
|
imgDecrease.gameObject.SetActive(!_isPvPSuccess);
|
2024-09-29 12:38:43 +08:00
|
|
|
|
txtScoreChange.text = _isPvPSuccess? $"<color=#B9BC09>+{add}</color>" : $"<color=#C61D1B>{add}</color>";
|
2024-09-26 19:25:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
_PlayScoreAnim(old, now, txtScore);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _RefreshPvPRank()
|
|
|
|
|
|
{
|
|
|
|
|
|
var old = _settleData.Rank;
|
|
|
|
|
|
var now = _newPVPData.Rank;
|
|
|
|
|
|
var add = old - now;
|
|
|
|
|
|
var txtRankChange = CommonUtils.GetComponent<TMP_Text>(_goPvPDetail, "Image_Ranking/Text_Change");
|
|
|
|
|
|
var txtScore = CommonUtils.GetComponent<TMP_Text>(_goPvPDetail, "Image_Ranking/Text_Current");
|
|
|
|
|
|
var imgAdd = CommonUtils.GetComponent<Image>(_goPvPDetail, "Image_Ranking/Image_Increase");
|
|
|
|
|
|
var imgDecrease = CommonUtils.GetComponent<Image>(_goPvPDetail, "Image_Ranking/Image_Decrease");
|
|
|
|
|
|
if (add == 0)
|
|
|
|
|
|
txtRankChange.text = "";
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (old <= 0 && add < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
add = -add;
|
|
|
|
|
|
}
|
|
|
|
|
|
imgAdd.gameObject.SetActive(_isPvPSuccess);
|
|
|
|
|
|
imgDecrease.gameObject.SetActive(!_isPvPSuccess);
|
2024-09-29 12:38:43 +08:00
|
|
|
|
txtRankChange.text = _isPvPSuccess? $"<color=#B9BC09>+{add}</color>" : $"<color=#C61D1B>{add}</color>";
|
2024-09-26 19:25:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
_PlayRankAnim(old, now, txtScore);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _PlayScoreAnim(int old, int now, TMP_Text txt)
|
|
|
|
|
|
{
|
|
|
|
|
|
var tw = DOTween.To(() => old, value =>
|
|
|
|
|
|
{
|
|
|
|
|
|
_isPlaying = true;
|
|
|
|
|
|
txt.text = value.ToString();
|
|
|
|
|
|
}, now, 1.5f);
|
|
|
|
|
|
_seqPvp.Append(tw);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void _PlayRankAnim(int old, int now, TMP_Text txt)
|
|
|
|
|
|
{
|
|
|
|
|
|
var tw = DOTween.To(() => old, value =>
|
|
|
|
|
|
{
|
|
|
|
|
|
txt.text = value.ToString();
|
|
|
|
|
|
}, now, 1.5f);
|
|
|
|
|
|
_seqPvp.Join(tw);
|
|
|
|
|
|
_seqPvp.AppendCallback(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
_isPlaying = false;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-05-06 15:35:03 +08:00
|
|
|
|
}
|