From 3f2cd27c5dfb3b450245bf1a37fc1b3414031c7c Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 11 二月 2026 11:03:58 +0800
Subject: [PATCH] 小游戏适配 资源系统改造
---
Main/System/Main/HeroFightingCardCell.cs | 84 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 84 insertions(+), 0 deletions(-)
diff --git a/Main/System/Main/HeroFightingCardCell.cs b/Main/System/Main/HeroFightingCardCell.cs
index 08a8e9f..bb27300 100644
--- a/Main/System/Main/HeroFightingCardCell.cs
+++ b/Main/System/Main/HeroFightingCardCell.cs
@@ -1,6 +1,7 @@
锘縰sing UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
//涓荤晫闈㈠崱鐗�
public class HeroFightingCardCell : MonoBehaviour
@@ -118,6 +119,89 @@
}
+ public async UniTask DisplayAsync(int index, List<TeamHero> heros)
+ {
+ TeamHero teamHero = null;
+ if (index < heros.Count)
+ {
+ teamHero = heros[index];
+ }
+ guid = teamHero != null ? teamHero.guid : "";
+ if (guid == "")
+ {
+ clickHeroBtn.SetActive(false);
+ clickEmptyBtn.SetActive(true);
+ clickEmptyBtn.AddListener(ClickEmpty);
+ emptyLockImg.SetActive(false);
+ redPointImg.SetActive(false);
+
+ int lockCnt = HeroUIManager.Instance.lockIndexList.Count;
+ //鏍规嵁閿佹暟閲� 鍊掑簭鍒ゆ柇閿佷綇
+ if (lockCnt > 0)
+ {
+ lockIndex = lockCnt - (TeamConst.MaxTeamHeroCount - 1 - index) - 1;
+ if (lockIndex >= 0 && lockIndex < lockCnt)
+ {
+ emptyLockImg.SetActive(true);
+ redPointImg.SetActive(HeroUIManager.Instance.CanUnLock(HeroUIManager.Instance.lockIndexList[lockIndex]));
+ }
+ }
+
+ return;
+ }
+ else
+ {
+ clickHeroBtn.SetActive(true);
+ clickEmptyBtn.SetActive(false);
+ }
+
+ var hero = HeroManager.Instance.GetHero(guid);
+ var heroID = hero.heroId;
+ var star = hero.heroStar;
+ clickHeroBtn.AddListener(ClickHero);
+ var heroConfig = HeroConfig.Get(heroID);
+ qualityBG.SetSprite("herocBG" + heroConfig.Quality);
+
+ var sprite = await UILoader.LoadSpriteAsync("HeroHead", HeroSkinConfig.Get(hero.SkinID).RectangleIcon);
+ if (this == null) return;
+ if (sprite == null)
+ {
+ // 鍐呯綉鏈厤缃椂
+ heroIcon.SetSprite("herohead_big_default");
+ }
+ else
+ {
+ heroIcon.overrideSprite = sprite;
+ }
+
+ if (star == 0)
+ {
+ starRect.SetActive(false);
+ }
+ else
+ {
+ starRect.SetActive(true);
+ for (int i = 0; i < starsImg.Count; i++)
+ {
+ if ((star - 1) % starsImg.Count >= i)
+ {
+ starsImg[i].SetActive(true);
+ starsImg[i].SetSprite("herostar" + (((star - 1) / starsImg.Count) + 1) * starsImg.Count);
+ }
+ else
+ {
+ starsImg[i].SetActive(false);
+ }
+ }
+ }
+
+ countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
+ lvText.text = hero.heroLevel == 0 ? "" : Language.Get("L1094") + hero.heroLevel;
+
+ // RefreshFightIng(false);
+
+ }
+
void ClickHero()
{
--
Gitblit v1.8.0