mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 02:47:12 +08:00
55 lines
1.2 KiB
C#
55 lines
1.2 KiB
C#
|
|
using System;
|
||
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace UI
|
||
|
|
{
|
||
|
|
public class WaitStartUI:MonoBehaviour
|
||
|
|
{
|
||
|
|
public TMP_Text text;
|
||
|
|
public string baseText;
|
||
|
|
|
||
|
|
public int dotCount = 3;
|
||
|
|
public int dotCounter = 0;
|
||
|
|
|
||
|
|
public float updateTime = 1;
|
||
|
|
private float timer = 0;
|
||
|
|
|
||
|
|
private void Start()
|
||
|
|
{
|
||
|
|
if(string.IsNullOrEmpty(baseText))
|
||
|
|
{
|
||
|
|
baseText = text.text;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
text.text = baseText;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void Update()
|
||
|
|
{
|
||
|
|
timer+=Time.deltaTime;
|
||
|
|
if (this.timer >= updateTime)
|
||
|
|
{
|
||
|
|
timer-=updateTime;
|
||
|
|
var dots = "";
|
||
|
|
for (var i = 0; i < dotCounter; i++)
|
||
|
|
{
|
||
|
|
dots += ".";
|
||
|
|
}
|
||
|
|
text.text = baseText + dots;
|
||
|
|
dotCounter += 1;
|
||
|
|
if (dotCounter > dotCount)
|
||
|
|
{
|
||
|
|
dotCounter = 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Hide()
|
||
|
|
{
|
||
|
|
gameObject.SetActive(false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|