CustomRoleListCell.cs 649 B

123456789101112131415161718192021222324252627
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace MetaClient
  6. {
  7. public class CustomRoleListCell : MonoBehaviour
  8. {
  9. public Text Message;
  10. private DRCustomBody bodyData;
  11. private CustomRoleForm form;
  12. public void Init(DRCustomBody _data,CustomRoleForm _form)
  13. {
  14. bodyData = _data;
  15. form = _form;
  16. Message.text = bodyData.Name;
  17. var btn = GetComponent<Button>();
  18. btn.onClick.AddListener(() =>
  19. {
  20. form.ClickListCell(bodyData);
  21. });
  22. }
  23. }
  24. }