29 lines
595 B
C#
29 lines
595 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
public class FlowingAnimation : MonoBehaviour
|
|
{
|
|
public Image[] imgs;
|
|
public Color[] colors;
|
|
int index=4;
|
|
void Start()
|
|
{
|
|
imgs = GetComponentsInChildren<Image>();
|
|
|
|
InvokeRepeating("SetColor", 0f, 0.3f);
|
|
//SetColor();
|
|
}
|
|
void SetColor()
|
|
{
|
|
for (int i = 0; i < imgs.Length; i++)
|
|
{
|
|
imgs[i].color = colors[i% index];
|
|
}
|
|
if (index > 1)
|
|
index--;
|
|
else
|
|
index = 4;
|
|
}
|
|
}
|