36 lines
903 B
C#
36 lines
903 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class ButtonHoverScript : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler
|
|
{
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
//transform.DOMove
|
|
Debug.Log("鼠标悬浮");
|
|
//gameObject.transform.localScale = new Vector3(1.01f, 1.01f, 1f);
|
|
transform.DOScale(new Vector3(1.01f, 1.01f, 1f),0.2f);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
Debug.Log("鼠标松开");
|
|
transform.DOScale(new Vector3(1f, 1f, 1f), 0.2f);
|
|
//gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
|
|
}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|