PopConfirmChange.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class PopConfirmChange : PopBase {
  6. [SerializeField]
  7. private Game3DButton CancelBtn;
  8. [SerializeField]
  9. private Game3DButton OkBtn;
  10. [SerializeField]
  11. private TextMesh MText;
  12. private string format_str = "";
  13. protected override void Start () {
  14. base.Start();
  15. CancelBtn.onClick.AddListener(QuitClick);
  16. OkBtn.onClick.AddListener(OkClick);
  17. }
  18. //框体类型
  19. public override PopType MType { get { return PopType.ChangeMaster; } }
  20. protected override void OnDestroy()
  21. {
  22. base.OnDestroy();
  23. CancelBtn.onClick.RemoveListener(QuitClick);
  24. OkBtn.onClick.RemoveListener(OkClick);
  25. }
  26. private UserData user_data;
  27. public override void Show(System.Object data)
  28. {
  29. base.Show(data);
  30. user_data = data as UserData;
  31. }
  32. private void QuitClick()
  33. {
  34. this.Hide();
  35. }
  36. private void OkClick()
  37. {
  38. this.Hide();
  39. //先判断是不是房主
  40. var check = GamePlayerData.Instance.room_data.IsReconnectOwner();
  41. MessageCenterController.Instance.Broadcast(GameEnum.MESSAGE_SEND_CHANGE_MASTER_SOCKET_DATA, user_data);
  42. }
  43. }