123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- public class PopImage : PopBase, IPointerUpHandler, IPointerDownHandler
- {
- [SerializeField]
- private Game3DButton CloseBtn;
- [SerializeField]
- private UnityEngine.UI.RawImage Image;
- protected override void Start()
- {
- base.Start();
- CloseBtn.onClick.AddListener(OnClick);
- }
- //框体类型
- public override PopType MType { get { return PopType.Image; } }
- public override void Show(System.Object data)
- {
- UnityEngine.UI.RawImage target = data as UnityEngine.UI.RawImage;
- this.Image.texture = target.texture;
- base.Show();
- CDebug.Log("显示");
- }
- private void OnClick()
- {
- this.Hide();
- }
- private bool isEnter = false;
- public virtual void OnPointerUp(PointerEventData eventData)
- {
- if (isEnter)
- {
- isEnter = false;
- CDebug.Log("隐藏OnPointerDown");
- OnClick();
- }
- }
- public virtual void OnPointerDown(PointerEventData eventData)
- {
- isEnter = true;
- }
- }
|