VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
AVR_CircularLoadingBar_TMP.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEngine.UI;
5 
6 namespace AVR.UI.Utils {
7  [ExecuteInEditMode]
8  public class AVR_CircularLoadingBar_TMP : AVR.Core.AVR_Behaviour
9  {
10  public Image ringImage;
11 
12  public TMPro.TMP_Text percentage_text;
13 
14  [Range(0, 1)]
15  public float fillAmount = 0.5f;
16 
17  void Update()
18  {
19  ringImage.fillAmount = fillAmount;
20 
21  if(percentage_text) {
22  percentage_text.text = Mathf.RoundToInt(fillAmount*100).ToString() + "%";
23  }
24  }
25  }
26 }