You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
839 B
40 lines
839 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using System;
|
|
using Cinemachine;
|
|
using UnityEngine.UI;
|
|
public class ProgressBar : MonoBehaviour
|
|
{
|
|
Transform pro;
|
|
public float curnumber;
|
|
float min_maturity = 0.1f;
|
|
float max_maturity = 0.9f;
|
|
float speed = 3;
|
|
float time1 = 0;
|
|
private void Awake()
|
|
{
|
|
pro = transform.GetChild(1);
|
|
}
|
|
private void Start()
|
|
{
|
|
|
|
}
|
|
private void Update()
|
|
{
|
|
time1 += Time.deltaTime;
|
|
if (time1 >= speed)
|
|
{
|
|
time1 = 0;
|
|
curnumber+=0.01f;
|
|
if (curnumber > max_maturity) curnumber = min_maturity;
|
|
}
|
|
|
|
pro.GetComponent<Image>().fillAmount = curnumber;
|
|
|
|
}
|
|
|
|
public void finishTask() {
|
|
TaskManager.Instance.FinishTask(0);
|
|
}
|
|
} |