InviteDlgPanel.cs 832 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class InviteDlgPanel : MonoBehaviour
  5. {
  6. public List<InviteDlgUserItem> listItem;
  7. public List<InviteUserConfig> listConfig;
  8. private int ItemCount;
  9. private void Start()
  10. {
  11. ItemCount = 0;
  12. }
  13. public void Init(List<InviteUserConfig> inviteUserConfigList)
  14. {
  15. DestoryAll();
  16. for (int i = 0; i < inviteUserConfigList.Count; i++)
  17. {
  18. if(ItemCount<listItem.Count)
  19. {
  20. listItem[ItemCount++].SetData(null, "组长", inviteUserConfigList[i]);
  21. }
  22. }
  23. }
  24. public void DestoryAll()
  25. {
  26. for (int i = 0; i < ItemCount; i++)
  27. {
  28. listItem[i++].ResetData();
  29. }
  30. ItemCount = 0;
  31. }
  32. }