34 lines
699 B
C#
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";
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|