using UnityEngine.UI;
|
using UnityEngine;
|
using DG.Tweening;
|
public class DoubleHitImg : MonoBehaviour
|
{
|
//[SerializeField]
|
//private Sprite hit_10;
|
private Image _image;
|
private Color normal, dark;
|
// Start is called before the first frame update
|
void Start()
|
{
|
_image = GetComponent<Image>();
|
normal = new Color(1.0f, 1.0f, 1.0f, 1.0f);
|
dark = new Color(1.0f, 1.0f, 1.0f, 0.0f);
|
isShowing = false;
|
}
|
|
bool isShowing;
|
private float showTime = 3.0f;
|
private Vector3 showV3 = new Vector3(0.7f, 0.7f, 0.7f);
|
public void SetkillCount()
|
{
|
_image.DOKill();
|
_image.color = dark;
|
transform.localScale = showV3;
|
|
_image.DOColor(normal, showTime * 0.5f).OnComplete(() =>
|
{
|
_image.DOColor(dark, showTime * 0.5f);
|
});
|
transform.DOScale(Vector3.one, showTime * 0.5f).SetEase(Ease.OutElastic);
|
}
|
|
|
}
|