Files
Continentis/Assets/OtherPlugins/Modern UI Pack/Scripts/Slider/RangeMinSlider.cs
SoulliesOfficial d09b58fd80 架构大更
2026-03-20 11:56:50 -04:00

38 lines
961 B
C#

using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Michsky.MUIP
{
public class RangeMinSlider : Slider
{
[Header("RESOURCES")] public RangeMaxSlider maxSlider;
public TextMeshProUGUI label;
public string numberFormat;
protected override void Set(float input, bool sendCallback)
{
if (maxSlider == null)
maxSlider = transform.parent.Find("Max Slider").GetComponent<RangeMaxSlider>();
var newValue = input;
if (wholeNumbers)
newValue = Mathf.Round(newValue);
if (newValue >= maxSlider.realValue && maxSlider.realValue != maxSlider.minValue)
return;
if (label != null)
label.text = newValue.ToString(numberFormat);
base.Set(input, sendCallback);
}
public void Refresh(float input)
{
Set(input, false);
}
}
}