mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
24 lines
592 B
C#
24 lines
592 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using System.Collections;
|
|
using DG.Tweening;
|
|
|
|
public class EaseX : MonoBehaviour
|
|
{
|
|
public Image imgFlash, imgSmoothFlash;
|
|
public Color flashColor;
|
|
[Header("Tween Settings")]
|
|
public float duration = 2;
|
|
public Ease ease;
|
|
public float overshootOrAmplitude = 16;
|
|
public float period = 1;
|
|
|
|
public void Play()
|
|
{
|
|
DOTween.RewindAll();
|
|
DOTween.KillAll();
|
|
|
|
imgFlash.DOColor(flashColor, duration).SetEase(ease, overshootOrAmplitude, period);
|
|
imgSmoothFlash.DOColor(flashColor, duration).SetEase(ease, overshootOrAmplitude - 1, period);
|
|
}
|
|
} |