37 lines
920 B
C#
Raw Normal View History

2021-07-29 15:45:44 +08:00
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class RaceMaskScript : MonoBehaviour, IPointerEnterHandler,IPointerExitHandler
{
2021-08-09 16:32:47 +08:00
float? localY = null;
2021-07-29 15:45:44 +08:00
public void OnPointerEnter(PointerEventData eventData)
{
2021-07-29 19:55:29 +08:00
transform.Find("Panel").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
2021-08-09 16:32:47 +08:00
if (localY == null)
{
localY = transform.localPosition.y;
}
transform.DOLocalMoveY(localY.Value + 5, 0.3f);
2021-07-29 15:45:44 +08:00
}
public void OnPointerExit(PointerEventData eventData)
{
2021-07-29 19:55:29 +08:00
transform.Find("Panel").GetComponent<CanvasGroup>().DOFade(0, 0.5f);
2021-08-09 16:32:47 +08:00
transform.DOLocalMoveY(localY.Value, 0.3f);
2021-07-29 15:45:44 +08:00
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}