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

public class ChangeImages : MonoBehaviour
{
    [SerializeField] private Button buttRef, buttRefW, buttColor, ButtTemp;
    [SerializeField] private RoscanModelUnity model;
    [SerializeField] private Sprite[] images;

    /// <summary> public methos to change features of buttons </summary>
    public void ChangeButtonFeatures()
    {
        if(model.AvailableLayers.HasFlag(RoscanModelUnity.ModelLayers.DISTANCE))
        {
            // setting images
            buttRef.image.sprite = images[4];
            buttRefW.image.sprite = images[5];
            buttColor.image.sprite = images[6];
            ButtTemp.image.sprite = images[7];

            Text textButt =  buttColor.GetComponentInChildren<Text>();
            textButt.text = "Distance";

        }
        else
        {
            buttRef.image.sprite = images[0];
            buttRefW.image.sprite = images[1];
            buttColor.image.sprite = images[2];
            ButtTemp.image.sprite = images[3];

            Text textButt = buttColor.GetComponentInChildren<Text>();
            textButt.text = "Distance";
        }
    }


}
