com.alicizax.unity.tuyoogam.../Samples~/Space Shooter/GameScript/Runtime/WindowLogic/UILoadingWindow.cs
陈思海 01160cf00c init
2025-01-09 11:31:04 +08:00

39 lines
896 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UniFramework.Utility;
public class UILoadingWindow : MonoBehaviour
{
private readonly UniTimer _timer = UniTimer.CreatePepeatTimer(0, 0.2f);
private Text _info;
private int _countdown;
private void Awake()
{
_info = this.transform.Find("info").GetComponent<Text>();
}
private void Start()
{
_info.text = "Loading";
_timer.Reset();
_countdown = 0;
}
private void Update()
{
if (_timer.Update(Time.deltaTime))
{
_countdown++;
if (_countdown > 6)
_countdown = 0;
string tips = "Loading";
for (int i = 0; i < _countdown; i++)
{
tips += ".";
}
_info.text = tips;
}
}
}