using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class JDT : MonoBehaviour { Image image; public float timescalx = 3; public float max=1; public float min = 0; float time = 0; private void Start() { image=transform.GetChild(0).GetComponent(); image.fillAmount = 0; } // Update is called once per frame void Update() { if (image.fillAmount >= 1f) return; time += Time.deltaTime; if (time >= timescalx) { time = 0; image.fillAmount += 0.01f; } } }