TH1/Unity/Assets/Scripts/TH1_UI/TechTreeButtonAnimator.cs
2025-08-18 23:16:13 +08:00

26 lines
714 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class TechTreeButtonAnimator : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public GameObject background;
// Start is called before the first frame update
void Start()
{
//this.GetComponent<Button>().onClick.AddListener(OnTechTreeButtonClicked);
}
public void OnPointerDown(PointerEventData eventData)
{
background.GetComponent<Animator>().SetTrigger("OnPointerDown");
}
public void OnPointerUp(PointerEventData eventData)
{
background.GetComponent<Animator>().SetTrigger("OnPointerUp");
}
}