-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircularLoadingDash.cs
More file actions
33 lines (27 loc) · 860 Bytes
/
CircularLoadingDash.cs
File metadata and controls
33 lines (27 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class CircularLoadingDash : MonoBehaviour {
public Image circularSilder; //Drag the circular image i.e Slider in our case
public float time; //In how much time the progress bar will fill/empty
public static bool resetTimer = false;
public static bool dashAvailable = false;
void Start()
{
circularSilder.fillAmount = 0f; // Initally progress bar is empty
}
void Update()
{
circularSilder.fillAmount += Time.deltaTime / time;
if (resetTimer)
{
dashAvailable = false;
circularSilder.fillAmount = 0f;
resetTimer = false;
}
if(circularSilder.fillAmount.Equals(1f))
{
dashAvailable = true;
}
}
}