Json修改

This commit is contained in:
lq 2024-12-24 09:24:45 +08:00
parent 44400ea519
commit a6002493cd
2 changed files with 16 additions and 5736 deletions

File diff suppressed because it is too large Load Diff

View File

@ -115,27 +115,27 @@ public class Panel : Base
//动态加载人员
public async void DynamicLoadingPeople()
{
for (int i = 0; i < 10; i++)
{
GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
PeopleItem peopleItem = item.GetComponent<PeopleItem>();
peopleItem.nameText.text = "角色1";
peopleItem.peopleId = "0";
Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
peopleList.Add(item);// 将每个实例化的角色添加到列表中
}
//PlayerListResponse playerListResponse = await userInfo.GetPlayerList();
//foreach (PlayerListData player in playerListResponse.data)
//for (int i = 0; i < 10; i++)
//{
// GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
// PeopleItem peopleItem = item.GetComponent<PeopleItem>();
// peopleItem.nameText.text = player.NickName;
// peopleItem.peopleId = player.UserId;
// peopleItem.nameText.text = "角色1";
// peopleItem.peopleId = "0";
// Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
// peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
// peopleList.Add(item);// 将每个实例化的角色添加到列表中
//}
PlayerListResponse playerListResponse = await userInfo.GetPlayerList();
foreach (PlayerListData player in playerListResponse.data)
{
GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
PeopleItem peopleItem = item.GetComponent<PeopleItem>();
peopleItem.nameText.text = player.NickName;
peopleItem.peopleId = player.UserId;
Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
peopleList.Add(item);// 将每个实例化的角色添加到列表中
}
}
//动态加载职责