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> | |||
|  | /// <20><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> | |||
|  | /// </summary> | |||
|  | public class BtnTapEvent : MonoBehaviour | |||
|  | { | |||
|  |     public bool isAnim; | |||
|  | 
 | |||
|  |     /// <summary> | |||
|  |     /// <20><>ť | |||
|  |     /// </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")); | |||
|  |         }); | |||
|  |     } | |||
|  | } |