using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; using LzFramework; namespace DisComputer { /* *@func 动画播放组件 * @autor lz * */ public class UIAnimator : MonoBehaviour { public static UIAnimator Singleton { get { return SingletonCreator.Create(); } } /// /// 按钮点击动效 /// /// 目标 /// 缩放指书 /// 间隔 public void BtnShakeAct(Transform target,float scaleVal,float interval) { Sequence mysequence = DOTween.Sequence(); mysequence.Append(target.DOScale(new Vector3(scaleVal, scaleVal, scaleVal), interval * 0.5f)).SetEase(Ease.InSine); mysequence.Append(target.DOScale(new Vector3(1, 1, 1), interval * 0.5f)).SetEase(Ease.InSine); } private bool isCool = false; public bool CoolInterval(float interval) { if (isCool) { return true; }else { isCool = true; StartCoroutine("CoolProgress", interval); return false; } } /// /// 冷却进度 /// /// IEnumerator CoolProgress(float interval) { //Debug.Log("进入冷却"); yield return new WaitForSeconds(interval); isCool = false; //Debug.Log("冷却完成"); } } }