From 844aa91cb048f759ab3cc0cd5a66cefeddc6c448 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Thu, 2 Jan 2025 16:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Res/gsj/scripts/Personnelpreparation.cs | 17 ++++++++++++++--- .../Script/DirllInterface/getPlayerList.cs | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/xiaofang/Assets/Res/gsj/scripts/Personnelpreparation.cs b/xiaofang/Assets/Res/gsj/scripts/Personnelpreparation.cs index d22c01f4..396fdeca 100644 --- a/xiaofang/Assets/Res/gsj/scripts/Personnelpreparation.cs +++ b/xiaofang/Assets/Res/gsj/scripts/Personnelpreparation.cs @@ -14,8 +14,11 @@ public class Personnelpreparation : MonoBehaviour // 定义一个事件,用于在子物体状态变化时触发重新排序 public UnityEvent onStatusChanged; public PlayerStatisticsResponse playerStatisticsResponse; - //public getPlayerList userInfo; - // Start is called before the first frame update + public getPlayerList userInfo; + public Sprite ready; + public Sprite Nready; + // Start is called before the first frame upd + // ate void Start() { instance = this; @@ -60,11 +63,19 @@ public class Personnelpreparation : MonoBehaviour GameObject ob = Instantiate(item); ob.transform.SetParent(scrollView.content.transform, false); subObjects.Add(ob.transform); + if(playerStatisticsResponse.Data[i].IsReady) + { + ob.transform.Find("Image").GetComponent().sprite = ready; + } + else + { + ob.transform.Find("Image").GetComponent().sprite = Nready; + } foreach (var item in playerListResponse.data) { if (playerStatisticsResponse.Data[i].UserId.ToString() == item.UserId) { - ob.transform.Find("Text (Legacy)").GetComponent().text = playerStatisticsResponse.Data[i].UserId.ToString(); + ob.transform.Find("Text (Legacy)").GetComponent().text = playerStatisticsResponse.Data[i].UserName.ToString(); } } diff --git a/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs b/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs index b9ca5339..39ac3b57 100644 --- a/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs +++ b/xiaofang/Assets/Script/DirllInterface/getPlayerList.cs @@ -29,7 +29,7 @@ public class getPlayerList : MonoBehaviour string response = await web.SendRequest(web.URL + "/admin/companyUser/player/list", "GET", "{}", CreateHeaders()); Debug.Log("获取演练账号列表" + response); - // 解析服务器返回的数据 + // 解析服务器返回的数据 PlayerListResponse playerListResponse = JsonConvert.DeserializeObject(response); Debug.Log(playerListResponse.data[0].UserId); Debug.Log(playerListResponse.data[0].UserName);