using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AutoRange : MonoBehaviour
{
    [SerializeField] private Slider slider, slider2;
    [SerializeField] private Text sliderText1, sliderText2;
    [SerializeField] private RoscanModelUnity model;

    /// <summary>After clicking the button, Auto range sliders to default values</summary>
    public void AutoRangeBetweenPanels()
    {
        if (slider.value != model.LayerValueMin && slider.value != 0)
        {
            slider.value = model.LayerValueMin;
            slider2.value = model.LayerValueMax;

            model.PaletteMin = slider.value;
            model.PaletteMax = slider2.value;

            sliderText1.text = slider.value.ToString();
            sliderText2.text = slider2.value.ToString();

            model.ResetColorPoints(model.points);
        }
    }
}
