diff options
Diffstat (limited to 'Playground/Assets/Modern Shooting UI Pack/Modern Shooting UI Resources/Scripts/CircleSlider.cs')
-rw-r--r-- | Playground/Assets/Modern Shooting UI Pack/Modern Shooting UI Resources/Scripts/CircleSlider.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Playground/Assets/Modern Shooting UI Pack/Modern Shooting UI Resources/Scripts/CircleSlider.cs b/Playground/Assets/Modern Shooting UI Pack/Modern Shooting UI Resources/Scripts/CircleSlider.cs new file mode 100644 index 0000000..cce52f1 --- /dev/null +++ b/Playground/Assets/Modern Shooting UI Pack/Modern Shooting UI Resources/Scripts/CircleSlider.cs @@ -0,0 +1,42 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +public class CircleSlider : MonoBehaviour +{ + + public bool b=true; + public Image image; + public float speed=0.5f; + + float time =0f; + + public Text progress; + + void Start() + { + + image = GetComponent<Image>(); + } + + void Update() + { + if(b) + { + time+=Time.deltaTime*speed; + image.fillAmount= time; + if(progress) + { + progress.text = (int)(image.fillAmount*100)+"%"; + } + + if(time>1) + { + + time=0; + } + } + } + + +} |