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);