mycj_demo/mycj/Assets/Script/Progress_Display.cs
2024-12-02 23:38:32 +08:00

34 lines
699 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Progress_Display : MonoBehaviour
{
public static Progress_Display Instance;
public Image huadongImg;
public float count;
public Text huadongTxt;
// Start is called before the first frame update
void Start()
{
Instance = this;
}
public void huadongClick(float count)
{
if ((this.count +count)>20)
{
this.count = 20;
}
else
{
this.count += count;
}
huadongImg.fillAmount = this.count / 20;
huadongTxt.text = this.count + "/20";
}
}