|
@@ -38,6 +38,7 @@ namespace ET.Client
|
|
|
HUDComonent.listGift[i - 1] = view.GetChild($"CompGift{i}").asCom;
|
|
|
}
|
|
|
|
|
|
+ HUDComonent.listRank.visible = false;
|
|
|
HUDComonent.pgTower.visible = false;
|
|
|
HUDComonent.pgBoss1.visible = false;
|
|
|
HUDComonent.pgBoss2.visible = false;
|
|
@@ -147,33 +148,47 @@ namespace ET.Client
|
|
|
var list = HUDComonent.listRank;
|
|
|
if (list == null) return;
|
|
|
|
|
|
- list.visible = a.InfoList != null && a.InfoList.Count > 0;
|
|
|
- if(list.visible)
|
|
|
+ for (int i = 0; i < a.InfoList.Count && i < list.numChildren; i++)
|
|
|
{
|
|
|
- int i = 0;
|
|
|
- for (; i < a.InfoList.Count; i++)
|
|
|
+ var chd = list.GetChildAt(i).asCom;
|
|
|
+ if(chd == null)
|
|
|
{
|
|
|
- var chd = list.GetChildAt(i).asCom;
|
|
|
- if(chd == null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- var txt = chd.GetChild("text");
|
|
|
- txt.text = a.InfoList[i].Name;
|
|
|
- chd.visible = true;
|
|
|
+ return;
|
|
|
}
|
|
|
- for(; i < 3; i++)
|
|
|
+ var txt = chd.GetChild("text");
|
|
|
+ txt.text = a.InfoList[i].Name;
|
|
|
+ var mask = chd.GetChild("compIcon").asCom;
|
|
|
+ var icon = mask.GetChild("iconLoader").asLoader;
|
|
|
+ var url = a.InfoList[i].Url;
|
|
|
+ if (!string.IsNullOrEmpty(url))
|
|
|
{
|
|
|
- var chd = list.GetChildAt(i);
|
|
|
- if(chd != null)
|
|
|
- {
|
|
|
- chd.visible = false;
|
|
|
- }
|
|
|
+ LoadHeadIcon(icon, url).Coroutine();
|
|
|
+ }
|
|
|
+ chd.visible = true;
|
|
|
+ }
|
|
|
+ for(int i = a.InfoList.Count; i < list.numChildren; i++)
|
|
|
+ {
|
|
|
+ var chd = list.GetChildAt(i);
|
|
|
+ if(chd != null)
|
|
|
+ {
|
|
|
+ chd.visible = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
}
|
|
|
+
|
|
|
+ private async ETTask LoadHeadIcon(GLoader loader, string url)
|
|
|
+ {
|
|
|
+ var tex = await UrlImageLoader.Instance.LoadImage(url);
|
|
|
+ if (tex != null)
|
|
|
+ {
|
|
|
+ if (GRoot.inst.GetChild("HUD") != null)
|
|
|
+ {
|
|
|
+ loader.texture = new NTexture(tex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
[Event]
|
|
|
public class ShowUIAnimationHandler : BEvent<ShowUIAnimation>
|