PowerOffPanel.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class PowerOffPanel : MonoBehaviour
  6. {
  7. /// <summary>
  8. /// 确定按钮
  9. /// </summary>
  10. [SerializeField]
  11. private Button m_ConfirmBtn;
  12. /// <summary>
  13. /// 取消按钮
  14. /// </summary>
  15. [SerializeField]
  16. private Button m_CancelBtn;
  17. [SerializeField]
  18. private GameObject m_GasPathPanel;
  19. public void OnBtnClickEvent(string _btnName)
  20. {
  21. switch (_btnName)
  22. {
  23. case "ConfirmBtn":
  24. OnConfirmBtnClick();
  25. break;
  26. case "CancelBtn":
  27. OnCancelBtnClick();
  28. break;
  29. }
  30. }
  31. /// <summary>
  32. /// 确认按钮
  33. /// </summary>
  34. private void OnConfirmBtnClick()
  35. {
  36. m_GasPathPanel?.SetActive(true);
  37. this.gameObject.SetActive(false);
  38. }
  39. /// <summary>
  40. /// 取消按钮
  41. /// </summary>
  42. private void OnCancelBtnClick()
  43. {
  44. this.gameObject.SetActive(false);
  45. }
  46. }