summaryrefslogtreecommitdiff
path: root/Pathfinding Visualizer/Assets/UI Elements/UI/Scripts/SliderScript.cs
blob: e930245efb73866d102d0fbbfb685853ad1b16fd (plain)
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;

public class SliderScript : MonoBehaviour
{

    [SerializeField] private Slider _slider;
    [SerializeField] private TextMeshProUGUI _sliderText;

    // Start is called before the first frame update
    void Start()
    {
        _slider.onValueChanged.AddListener((v) =>
        {
            _sliderText.text = v.ToString("0.00");
        });
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}