46 lines
902 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LoadingPf : PFUIPanel
{
List<Sprite> sprites;
Image image;
protected override void Start()
{
sprites = new List<Sprite>();
for (int i = 1; i < 80; i++)
{
sprites.Add(Resources.Load<Sprite>($"Images/全屏loading/loading{i.ToString("0000")}"));
}
image = transform.GetComponent<Image>();
}
int index = 0;
float time = 0;
public override void Show()
{
base.Show();
index = 0;
time = 0;
}
void Update()
{
time += Time.deltaTime;
if (time < 0.03)
{
return;
}
time = 0;
if (index % 79 == 0)
{
index = 0;
}
image.sprite = sprites[index];
index++;
}
}