From 3b2a6bb9047cfce9f501593b3669a9c1af6c5df4 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 05 十一月 2025 17:40:23 +0800
Subject: [PATCH] 130 战斗修改回合样式
---
Main/System/HeroUI/HeroPosHeadCell.cs | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/Main/System/HeroUI/HeroPosHeadCell.cs b/Main/System/HeroUI/HeroPosHeadCell.cs
index d0cfd2d..ba6249a 100644
--- a/Main/System/HeroUI/HeroPosHeadCell.cs
+++ b/Main/System/HeroUI/HeroPosHeadCell.cs
@@ -1,4 +1,5 @@
-锘縰sing UnityEngine;
+锘縰sing System.Collections.Generic;
+using UnityEngine;
using UnityEngine.UI;
public class HeroPosHeadCell : MonoBehaviour
@@ -10,7 +11,43 @@
public void Display(int index)
{
+ var guid = HeroUIManager.Instance.heroOnTeamSortList[index];
+ var hero = HeroManager.Instance.GetHero(guid);
+ var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
+ selectRect.SetActive(team.GetHero(guid) != null);
+ heroHeadBaseCell.Init(hero.heroId, hero.SkinID, hero.heroStar, hero.awakeLevel, hero.heroLevel, () =>
+ {
+ Click(hero, index);
+ });
+ nameText.text = hero.breakLevel == 0 ? hero.heroConfig.Name : Language.Get("herocardbreaklv", hero.heroConfig.Name, hero.breakLevel);
+
+ jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(hero.heroConfig.Class));
+ }
+
+ void Click(HeroInfo hero, int index)
+ {
+ //妫�鏌ユ槸鍚﹀彲涓婇樀锛屾煡鎵句笂闃典綅缃紝鏄剧ず鍕鹃�夛紝椋炲叆涓婇樀浣嶇疆
+ var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType);
+ int pos;
+ if (selectRect.gameObject.activeSelf)
+ {
+ selectRect.SetActive(false);
+ if (team.RemoveHero(hero, out pos))
+ {
+ //閫氱煡鍒锋柊锛堜笅闃碉級
+ HeroUIManager.Instance.NotifyOnTeamPosChangeEvent(new List<int>() { pos }, -1, Vector3.zero);
+ }
+ return;
+ }
+
+ team.AddHero(hero, out pos, true);
+ if (pos != -1)
+ {
+ selectRect.SetActive(true);
+ //閫氱煡鍒锋柊锛屼笂闃碉紝鍥剧墖椋炲叆锛堜笂闃典綅缃級
+ HeroUIManager.Instance.NotifyOnTeamPosChangeEvent(new List<int>() { pos }, index, heroHeadBaseCell.transform.position);
+ }
}
}
--
Gitblit v1.8.0