Compare commits

...

2 Commits

Author SHA1 Message Date
lq
2ad6d74aec Merge branch 'main' of http://shu.sheziwanglo.cn:3000/wulongxiao/_xiaofang 2024-12-24 09:25:10 +08:00
lq
a6002493cd Json修改 2024-12-24 09:24:45 +08:00
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() public async void DynamicLoadingPeople()
{ {
for (int i = 0; i < 10; i++) //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)
//{ //{
// GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent); // GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
// PeopleItem peopleItem = item.GetComponent<PeopleItem>(); // PeopleItem peopleItem = item.GetComponent<PeopleItem>();
// peopleItem.nameText.text = player.NickName; // peopleItem.nameText.text = "角色1";
// peopleItem.peopleId = player.UserId; // peopleItem.peopleId = "0";
// Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>(); // Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
// peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson)); // peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
// peopleList.Add(item);// 将每个实例化的角色添加到列表中 // 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);// 将每个实例化的角色添加到列表中
}
} }
//动态加载职责 //动态加载职责