chenxin
2020-11-07 d35d31d85fd4b827dc37008aef39c019b6a7781d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using UnityEngine;
using UnityEngine.EventSystems;
 
public class ImageSkillRim : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
    ImageSkill imageSkill;
 
    public void OnPointerEnter(PointerEventData eventData)
    {
        if (imageSkill.IsDraging)
        {
            imageSkill.SetTarget(gameObject);
        }
    }
 
    public void OnPointerExit(PointerEventData eventData)
    {
        if (imageSkill.IsDraging)
        {
            imageSkill.SetTarget(null);
        }
    }
 
    // Start is called before the first frame update
    void Start()
    {
        imageSkill = transform.parent.Find("Image_Skill").GetComponent<ImageSkill>();
    }
 
 
}