45 lines
994 B
C#
45 lines
994 B
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
/// <summary>
|
|
/// °´Å¥µã»÷ʼþ
|
|
/// </summary>
|
|
public class BtnTapEvent : MonoBehaviour
|
|
{
|
|
public bool isAnim;
|
|
|
|
/// <summary>
|
|
/// °´Å¥
|
|
/// </summary>
|
|
private Button btn;
|
|
|
|
private void Awake()
|
|
{
|
|
btn=GetComponent<Button>();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
BtnListener();
|
|
}
|
|
|
|
private void BtnListener()
|
|
{
|
|
btn.onClick.AddListener(() =>
|
|
{
|
|
if (isAnim)
|
|
{
|
|
btn.transform.DOKill();
|
|
btn.transform.DOScale(Vector3.one * 1.3f, 0.1f).OnComplete(() =>
|
|
{
|
|
btn.transform.DOScale(Vector3.one, 0.1f);
|
|
});
|
|
}
|
|
AudioManager.Instance.PlaySound(YooAssetManager.Instance.LoadAssetSync<AudioClip>(PackagesName.GameData,"TapUI"));
|
|
});
|
|
}
|
|
}
|