SChooseItem.cs 736 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.EventSystems;
  4. public class SChooseItem : MonoBehaviour,IPointerClickHandler
  5. {
  6. /// <summary>
  7. /// 当选择场景时触发事件
  8. /// </summary>
  9. public event Action<SceneValue, bool> OnSelectScene;
  10. private SceneValue m_SceneData;
  11. public SceneValue SceneData
  12. {
  13. get { return m_SceneData; }
  14. set { m_SceneData = value; }
  15. }
  16. public GameObject sceneChoose_go;
  17. private SceneChoose mSceneChoose;
  18. public void OnPointerClick(PointerEventData eventData)
  19. {
  20. mSceneChoose = sceneChoose_go.GetComponent<SceneChoose>();
  21. OnSelectScene?.Invoke(m_SceneData, true);
  22. mSceneChoose.OnClickOKBtn(m_SceneData);
  23. }
  24. }