From 108997fd934885b21c7cc7af3fcde171d5c3cca9 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期日, 31 八月 2025 13:20:24 +0800
Subject: [PATCH] 50 【主界面】核心主体 - 卡牌
---
Main/System/Main/HomeWin.cs | 45 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index eefb2ad..08fd8b7 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -12,6 +12,7 @@
//缁忛獙鍖�
[SerializeField] Text playerLevelText;
[SerializeField] SmoothSlider expSlider;
+ [SerializeField] Button officialUpBtn;
//浠诲姟鍖�
[SerializeField] Button taskButton; //寮曞鎴栬�呴鍙栦换鍔″鍔�
@@ -27,15 +28,15 @@
[SerializeField] Button changeHeroPosBtn;
- //绛夌骇
- [SerializeField] Button officialUpBtn;
+ //鍗$墝
+ [SerializeField] HeroFightingCardCell[] heroFightingCardCells;
//搴曢儴鍔熻兘
[SerializeField] Button autoBtn;
[SerializeField] Image autoCloseImg;
[SerializeField] UIEffectPlayer autoOpenEffect;
- [SerializeField] Button blessLVBtn;
+ [SerializeField] Button blessLVBtn;
[SerializeField] Text blessLVText;
//鍏朵粬鍔熻兘鍏ュ彛
@@ -97,7 +98,7 @@
UIManager.Instance.OpenWindow<BlessLVWin>();
});
- officialUpBtn.AddListener(()=>
+ officialUpBtn.AddListener(() =>
{
if (RealmConfig.GetKeys().Count <= PlayerDatas.Instance.baseData.realmLevel)
return;
@@ -115,6 +116,8 @@
RefreshRecharge();
ShowBlessLV();
DisplayAutoFight();
+ DisplayCard(TeamType.Story);
+
}
protected override void OnPreOpen()
@@ -123,6 +126,8 @@
TaskManager.Instance.OnTaskUpdate += UpdateTask;
BlessLVManager.Instance.OnBlessLVUpdateEvent += ShowBlessLV;
AutoFightModel.Instance.ChangeAutoEvent += DisplayAutoFight;
+ TeamManager.Instance.OnTeamChange += DisplayCard;
+ UIManager.Instance.OnCloseWindow += OnCloseWindow;
Display();
// var battleWin = UIManager.Instance.OpenWindow<BattleWin>();
// battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
@@ -136,6 +141,8 @@
TaskManager.Instance.OnTaskUpdate -= UpdateTask;
BlessLVManager.Instance.OnBlessLVUpdateEvent -= ShowBlessLV;
AutoFightModel.Instance.ChangeAutoEvent -= DisplayAutoFight;
+ TeamManager.Instance.OnTeamChange -= DisplayCard;
+ UIManager.Instance.OnCloseWindow -= OnCloseWindow;
// 鍏抽棴鐨勬椂鍊欐妸鎴樻枟鐣岄潰涔熺粰鍏充簡 铏界劧鏄湪澶栭潰寮�鐨�
UIManager.Instance.CloseWindow<BattleWin>();
@@ -158,7 +165,7 @@
}
void RefreshRecharge()
- {
+ {
monthCardBtn.SetActive(!InvestModel.Instance.IsInvested(InvestModel.monthCardType));
}
@@ -181,7 +188,7 @@
autoOpenEffect.Stop();
}
}
-
+
/// <summary>
/// 鏇存柊鐜╁淇℃伅
/// </summary>
@@ -201,7 +208,7 @@
void UpdateTask()
- {
+ {
var task = TaskManager.Instance.mainTask;
if (task.TaskID == 0)
{
@@ -213,9 +220,9 @@
var taskConfig = TaskConfig.Get(task.TaskID);
taskText.text = taskConfig.TaskDescribe;
taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue);
- taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red);
+ taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyYellow) : UIHelper.GetUIColor(TextColType.Red);
if (TaskManager.Instance.GetMainTaskState() == 2)
- {
+ {
taskEffect.Play();
}
else
@@ -242,4 +249,24 @@
//鏍规嵁浠诲姟绫诲瀷寮曞
}
}
+
+ void DisplayCard(TeamType teamType)
+ {
+ if (teamType != TeamType.Story)
+ return;
+ //鏄剧ず鍗$墝
+ for (int i = 0; i < heroFightingCardCells.Length; i++)
+ {
+ heroFightingCardCells[i].Display(i);
+ }
+ }
+
+ private void OnCloseWindow(UIBase closeUI)
+ {
+ //鍏朵粬姝﹀皢鍔熻兘浜х敓鏁版嵁鍙樺寲锛岄渶瑕佸埛鏂版灏嗗垪琛�
+ if (closeUI is HeroTrainWin)
+ {
+ DisplayCard(TeamType.Story);
+ }
+ }
}
\ No newline at end of file
--
Gitblit v1.8.0