人员配置
This commit is contained in:
parent
79ac436c2e
commit
844aa91cb0
@ -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<Image>().sprite = ready;
|
||||
}
|
||||
else
|
||||
{
|
||||
ob.transform.Find("Image").GetComponent<Image>().sprite = Nready;
|
||||
}
|
||||
foreach (var item in playerListResponse.data)
|
||||
{
|
||||
if (playerStatisticsResponse.Data[i].UserId.ToString() == item.UserId)
|
||||
{
|
||||
ob.transform.Find("Text (Legacy)").GetComponent<Text>().text = playerStatisticsResponse.Data[i].UserId.ToString();
|
||||
ob.transform.Find("Text (Legacy)").GetComponent<Text>().text = playerStatisticsResponse.Data[i].UserName.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user