using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class LoadingPf : MonoBehaviour { List sprites; Image image; private void Start() { sprites = new List(); for (int i = 1; i < 80; i++) { sprites.Add(Resources.Load($"Images/全屏loading/loading{i.ToString("0000")}")); } image = transform.GetComponent(); } int index = 0; float time = 0; public void Initial() { 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++; } }