36 lines
811 B
C#
36 lines
811 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
public class UI_ExamEndPanel : BasePanel
|
|
{
|
|
public float endQuitTime = 10f;
|
|
public bool isEnd = false;
|
|
public TextMeshProUGUI tips;
|
|
public Image circle;
|
|
|
|
public void OnInit()
|
|
{
|
|
isEnd = true;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (isEnd)
|
|
{
|
|
endQuitTime -= Time.deltaTime;
|
|
circle.fillAmount = Mathf.Lerp(0, 1, endQuitTime / 10f);
|
|
if (endQuitTime < 0)
|
|
{
|
|
endQuitTime = 0;
|
|
circle.fillAmount = 0;
|
|
Application.Quit();
|
|
isEnd = false;
|
|
}
|
|
tips.text = $"{endQuitTime.ToString("0")}<size=30>s</size>";
|
|
}
|
|
}
|
|
}
|