NG_/Assets/Data Visualization Resources/Scripts/CircleSlider.cs
2024-12-13 19:40:05 +08:00

38 lines
511 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CircleSlider : MonoBehaviour
{
public bool b=true;
public Image image;
public float speed=0.5f;
float time =0f;
public Text progress;
void Update()
{
if(b)
{
time+=Time.deltaTime*speed;
image.fillAmount= time;
if(progress)
{
progress.text = (int)(image.fillAmount*100)+"%";
}
if(time>1)
{
time=0;
}
}
}
}