12345678910111213141516171819202122232425262728293031 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using DG.Tweening;
- using UnityEngine.UI;
- public class UI_FlashTween : MonoBehaviour
- {
- public Image[] imgs;
- private Tween[] _tweens;
- private void Start()
- {
- _tweens = new Tween[imgs.Length];
- for (int i = 0; i < imgs.Length; i++)
- {
- imgs[i].color=Color.white;
- _tweens[i] = imgs[i].DOColor(Color.gray, 0.2f).SetLoops(-1, LoopType.Yoyo);
- }
- }
- private void OnDestroy()
- {
- for (int i = 0; i < _tweens.Length; i++)
- {
- DOTween.Kill(_tweens[i]);
- imgs[i].color=Color.white;
- }
- }
- }
|