continue to work on UI

This commit is contained in:
2024-09-29 14:42:07 +03:00
parent 20e145c091
commit 5b1e71306b
7 changed files with 128 additions and 25 deletions
+24
View File
@@ -0,0 +1,24 @@
using UnityEngine;
using UnityEngine.UIElements;
public class ProgressBar : MonoBehaviour
{
public VisualElement progressBarFill;
private float progress = 0f;
void Start()
{
var root = GetComponent<UIDocument>().rootVisualElement;
progressBarFill = root.Q<VisualElement>("progressFill");
}
void Update()
{
// Update progress value here
progress += Time.deltaTime * 0.1f; // Example increment
progress = Mathf.Clamp01(progress);
// Update the width of the progress bar fill
progressBarFill.style.width = new Length(progress * 100, LengthUnit.Percent);
}
}